ODBC error with javascript in ASP

ODBC error with javascript in ASP

Post by andr » Mon, 31 May 2004 19:15:33


Hi,

Maybe not the right newsgroup, but it's an ODBC problem, so ..

This ASP file works fine with VBscript:
<%
set objdc = Server.CreateObject("ADODB.Connection")
objdc.Open("provider=msdasql; driver={microsoft access driver (*.mdb)};
dbq=d:\access\newres.mdb")
sql="select dag, aantalu from daguur;"
set rs=Server.CreateObject("ADODB.Recordset")
rs.Open sql, objdc, 3, 3
rec=rs.recordcount
rs.movefirst
da=rs.Fields("dag").Value
aanu=rs.Fields("aantalu").Value
...
%>
But how to translate this in Javascript? I tried this but ger the error:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC Microsoft Access Driver]General error Unable to open
registry key 'Temporary (volatile) Jet DSN for process 0x4a8 Thread 0x6e8
DBC 0x227335c Jet'.
/respen/newres/testj.asp, line 4

<%@ language=javascript %>
<%
var objdc = Server.CreateObject("ADODB.Connection")
objdc.Open("provider=msdasql; driver={microsoft access driver (*.mdb)};
dbq=d:\access\newres.mdb")
sql="select dag, aantalu from daguur;"
var rs=Server.CreateObject("ADODB.Recordset")
rs.Open("sql, objdc, 3, 3")
rec=rs.recordcount
rs.movefirst
da=rs.Fields("dag").Value
aanu=rs.Fields("aantalu").Value
%>

Thanks
Andre