Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Object Required Error 1

Status
Not open for further replies.

joshbula

Technical User
Nov 19, 2004
45
US
Please help...

This is a script that was originally used with a microsoft access database for user id and password checking. I'm trying to modify it for use with a SQL Server instead of the Access database, but I keep getting this error:

Microsoft VBScript runtime (0x800A01A8)
Object required: '{string: "DRIVER={SQL Server};"]'
/fba/_private/logon19.inc, line 28

Any help would be greatly appreciated.

Thanks
...Josh

here is the logon19.inc script it's referring to:
Code:
<%
  ' Do not cache this page.
  Response.CacheControl = "no-cache"

  ' Define the name of the users table.
  Const USERS_TABLE  = "tblUsers"
  ' Define the path to the logon page.
  Const LOGON_PAGE   = "/fba/logon.asp"
  ' Define the path to the logon database.
  Const MDB_URL      = "membri"

  ' Check to see whether you have a current user name.
  If Len(Session("UID")) = 0 Then
    ' Are you currently on the logon page?
    If LCase(LOGON_PAGE) <> LCase(Request.ServerVariables("URL")) Then
      ' If not, set a session variable for the page that made the request...
      Session("REFERRER") = Request.ServerVariables("URL")
      ' ...and redirect to the logon page.
      Response.Redirect LOGON_PAGE
    End If
  End If

  ' This function checks for a username/password combination.
  Function ComparePassword(UID,PWD)
   Dim strSQL, objCN, objRS, ConnStr
   strSQL = "SELECT * FROM qryLogin WHERE FMEAID='" & UID & "' AND txtPassword='" & PWD & "');"
   'Use ns1.flmusiced.org for the data source for testing from your computer!
   Set connstr = "DRIVER={SQL Server};SERVER=Server-Local;DATABASE=membri;UID=fmea;PWD=xxxx;"
  
   set objRS = server.CreateObject("ADODB.Recordset")
   objRS.open strSql, connstr
   ComparePassword = Not(objRS.EOF)
   Set objRS = Nothing
   
   
  End Function
%>
 
Replace this:
Set connstr = "DRIVER=
By this:
connstr = "DRIVER=

The Set instruction is used for object instantiation, not for string.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Thanks, but now I'm getting this error message:

Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC SQL Server Driver][SQL Server]Line 1: Incorrect syntax near ')'.
/fba/_private/logon19.inc, line 31

Thanks,
...Josh
 
You may try this:
connstr = "Provider=SQLOLEDB;Data Source=Server-Local;Initial Catalog=membri;User ID=fmea;Password=xxxx;"

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Still the same message:

Microsoft OLE DB Provider for SQL Server (0x80040E14)
Line 1: Incorrect syntax near ')'.
/fba/_private/logon19.inc, line 31

....Josh
 
Incorrect syntax near ')'
???
No parenthese in the connection string I suggested you ...

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Good catch dilettante
strSQL = "SELECT * FROM qryLogin WHERE FMEAID='" & UID & "' AND txtPassword='" & PWD & "');"
Get rid of the parenthese and the semicolon:
strSQL = "SELECT * FROM qryLogin WHERE FMEAID='" & UID & "' AND txtPassword='" & PWD & "'"

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Awesome, that did it!! Thanks so much.

....Josh
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top