I am trying to create a function that connects to a db and returns a recordset but I cant seem to get it to work properly.<BR>For now I have it on the same page that I am calling it from.<BR>Here is the function:<BR>Function openDB(SQL)<BR>Dim objConn<BR>Dim strSQL<BR>Dim objRS<BR>Set objConn = Server.CreateObject("ADODB.Connection") <BR>objConn.ConnectionString = "DSN=TEAsst"<BR>objConn.Open <BR>Set objRS = Server.CreateObject("ADODB.Recordset") <BR>strSQL = SQL<BR>objRS.Open strSQL, objConn <BR>openDB = objRS<BR>End Function<BR><BR>&#039;///////Here is where I call it:<BR> Dim RS<BR> openDB("SELECT TENames FROM PullDowns")<BR>&#039;///////////////////////////////////////////The error I get points to the following line<BR>&#039;///////ERROR is:Wrong number of arguments or invalid property assignment: &#039;openDB&#039;<BR> RS = openDB<BR> Do Until RS.Eof<BR> If Trim(""& objRS("TENames") &#060;&#062; "") then<BR> optTEName = optTEName & "&#060;OPTION VALUE=""" & objRS("TENames") & """&#062;" & objRS("TENames") & "&#060;/OPTION&#062;"<BR> End If<BR> Loop<BR><BR>