Hello
I am getting the following server error on a Web page that displays MS Access records - and should add new records:
Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified /display_records2.asp, line 43
Line 43 is this:
connection.Open sConnString
, though this is not necessarily the error. I think the error lies somewhere here:
Code:
[<%
Dim Connection, Recordset, sSQL, sConnString, firstName (other field names)
fName = Replace( Request.Form("firstName"), "'", "''" )
(other field names)
sSQL="INSERT INTO myTable (firstName, other field names) VALUES ('" & fName & "', other field names)"
sSQL="SELECT TOP 30 ID, firstName, (other field names) FROM myTable"
Set connection = Server.CreateObject("ADODB.Connection")
Set recordset = Server.CreateObject("ADODB.Recordset")
connection.Open sConnString
recordset.Open sSQL,connection
sConnString="PROVIDER=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & Server.MapPath("myDatabase.mdb")
connection.Execute sSQL
What am I doing wrong please - how SHOULD the code look?
Many thanks for any suggestions.
Blue