Having a problem connecting to an Access Database, getting the following error in a login script. However I don't think the login script is at fault, i think it is my connection to the database. I have three methods of connecting of which one works and two do not.
With the one that works my whole site works OK, but with the other two, on the first database access (a simple select all from a single table) I get the error you see below.
Microsoft OLE DB Provider for ODBC Drivers error '80040e10'
[Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1.
login.asp, line 17
Line 17 is
set rs = myconnection.execute (SqlString)
Microsoft site says that the error results from a column name not being present in the table, but given that it works with one of the connect methods i don't think this can be the case.
Connection script is as follows
<%
dim myConnection, strConnect
dim strProvider
dim strDataSource
dim strPasswordParam
' This one works.
'strProvider = "Provider=Microsoft.Jet.OLEDB.4.0;"
'strDataSource = "Data Source=C:\My Documents\corporate.mdb;"
'strPasswordParam = ""
' This bit does not (local version).
'strProvider = "DRIVER={Microsoft Access Driver (*.mdb)};"
'strDataSource = "DBQ=C:\My Documents\corporate.mdb;"
'strPasswordParam = ""
' Nor does this.
strProvider = "DSN=webdata;"
strDataSource = ""
strPasswordParam = ""
' Build overall string and connect
strConnect = strProvider & strDataSource & strPasswordParam
set myConnection = Server.CreateObject ("ADODB.Connection"
myConnection.open strConnect
%>
Note that one of the three block in the middle is used, the other two are commented out to try out each method. I think it might be to do with my setup, but I am pulling my hair out on this one.
OS is Win 98, Access 2000 and PWS running the ASP.
Thanks
Ibby
With the one that works my whole site works OK, but with the other two, on the first database access (a simple select all from a single table) I get the error you see below.
Microsoft OLE DB Provider for ODBC Drivers error '80040e10'
[Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1.
login.asp, line 17
Line 17 is
set rs = myconnection.execute (SqlString)
Microsoft site says that the error results from a column name not being present in the table, but given that it works with one of the connect methods i don't think this can be the case.
Connection script is as follows
<%
dim myConnection, strConnect
dim strProvider
dim strDataSource
dim strPasswordParam
' This one works.
'strProvider = "Provider=Microsoft.Jet.OLEDB.4.0;"
'strDataSource = "Data Source=C:\My Documents\corporate.mdb;"
'strPasswordParam = ""
' This bit does not (local version).
'strProvider = "DRIVER={Microsoft Access Driver (*.mdb)};"
'strDataSource = "DBQ=C:\My Documents\corporate.mdb;"
'strPasswordParam = ""
' Nor does this.
strProvider = "DSN=webdata;"
strDataSource = ""
strPasswordParam = ""
' Build overall string and connect
strConnect = strProvider & strDataSource & strPasswordParam
set myConnection = Server.CreateObject ("ADODB.Connection"
myConnection.open strConnect
%>
Note that one of the three block in the middle is used, the other two are commented out to try out each method. I think it might be to do with my setup, but I am pulling my hair out on this one.
OS is Win 98, Access 2000 and PWS running the ASP.
Thanks
Ibby