gotpinoy Posted April 23, 2008 Share Posted April 23, 2008 Im new to ASP and trying to work on connecting to DSN. My files are in the following folder:C:\Inetpub\wwwroot\test\form.aspC:\Inetpub\wwwroot\test\submit.aspC:\Inetpub\data\testdata.mdbMy code submit.asp to get the data from the form and insert to database is <%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%><%'Set VariablesDim aconDim rsDim strSQLSet acon = Server.CreateObject("ADODB.Connection")acon.Open "dsn=testdsn;"Set rs = Server.CreateObject("ADODB.Recordset")strSQL= "SELECT * FROM testtable;"rs.Open strSQL, aconrs.AddNewrs.Fields("Name") = Request.Form("Name")rs.Updaters.CloseSet rs = NothingSet acon = Nothing%> Im receiving an error:Error Type:Microsoft OLE DB Provider for ODBC Drivers (0x80004005)[Microsoft][ODBC Microsoft Access Driver] The Microsoft Jet database engine cannot open the file '(unknown)'. It is already opened exclusively by another user, or you need permission to view its data. Link to comment Share on other sites More sharing options...
justsomeguy Posted April 23, 2008 Share Posted April 23, 2008 Did you set up the DSN to point to your database? Link to comment Share on other sites More sharing options...
gotpinoy Posted April 24, 2008 Author Share Posted April 24, 2008 Yes, I set it up in the control panel in the OBDC. I added a new DSN. Did you set up the DSN to point to your database? Link to comment Share on other sites More sharing options...
justsomeguy Posted April 24, 2008 Share Posted April 24, 2008 Since the error message says the file is unknown it sounds like the DSN isn't set up correctly. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.