Hello,
I am trying to access a query through asp using an Access database with a Pervasive SQL link. The linked table uses a DSN that I cannot enter a username and password into. Therefor, I have to enter the username and password everytime the DSN is accessed. I am able to access, through asp, just the linked tables and I am also able to access just the access database tables but I cannot access the query that uses both. Currently, I have the code working as follows:
-------------------------------------------------------
Dim vPath, pPath, Constring
vPath = "database\metacart.mdb"
pPath = Server.MapPath( vPath )
ConString = "PROVIDER=MICROSOFT.JET.OLEDB.4.0;DATA SOURCE=" & pPath & ";" & "JET OLEDBatabase Password=foo"
strSQL = "SELECT productID,productName,productPrice FROM qryproducts WHERE catalogID = '"&strParam&"'"
' Create and open our connection to access database
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open ConString
' Create and open our connection to the linked Pervasive SQL table (Pervasive SQL DSN)
Dim ConBW
Set ConBW = Server.CreateObject("ADODB.Connection")
ConBW.ConnectionString = "DSN=MZ_ODBC;UID=MAN4056;PASSWORD=j898736"
ConBW.open
' No Problems here
Set rsCatalog = Server.CreateObject("ADODB.Recordset")
rsCatalog.Open "catalogs",Conn,adOpenStatic,adLockReadOnly,adCmdTable
'PROBLEM STARTS HERE!!!!!!!!!!!!!!!!!!
Set rsProdInfo = Server.CreateObject("ADODB.Recordset")
rsProdInfo.PageSize = iPageSize
rsProdInfo.CacheSize = iPageSize
rsProdInfpen strSQL, Conn, adOpenStatic, adLockReadOnly, adCmdText
' END PROBLEM
-----------------------------------------------------------
Is there a way to open a DSN and an Access database simultaneously? Any help you could provide would really be appreciated.
Thanks!
I am trying to access a query through asp using an Access database with a Pervasive SQL link. The linked table uses a DSN that I cannot enter a username and password into. Therefor, I have to enter the username and password everytime the DSN is accessed. I am able to access, through asp, just the linked tables and I am also able to access just the access database tables but I cannot access the query that uses both. Currently, I have the code working as follows:
-------------------------------------------------------
Dim vPath, pPath, Constring
vPath = "database\metacart.mdb"
pPath = Server.MapPath( vPath )
ConString = "PROVIDER=MICROSOFT.JET.OLEDB.4.0;DATA SOURCE=" & pPath & ";" & "JET OLEDBatabase Password=foo"
strSQL = "SELECT productID,productName,productPrice FROM qryproducts WHERE catalogID = '"&strParam&"'"
' Create and open our connection to access database
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open ConString
' Create and open our connection to the linked Pervasive SQL table (Pervasive SQL DSN)
Dim ConBW
Set ConBW = Server.CreateObject("ADODB.Connection")
ConBW.ConnectionString = "DSN=MZ_ODBC;UID=MAN4056;PASSWORD=j898736"
ConBW.open
' No Problems here
Set rsCatalog = Server.CreateObject("ADODB.Recordset")
rsCatalog.Open "catalogs",Conn,adOpenStatic,adLockReadOnly,adCmdTable
'PROBLEM STARTS HERE!!!!!!!!!!!!!!!!!!
Set rsProdInfo = Server.CreateObject("ADODB.Recordset")
rsProdInfo.PageSize = iPageSize
rsProdInfo.CacheSize = iPageSize
rsProdInfpen strSQL, Conn, adOpenStatic, adLockReadOnly, adCmdText
' END PROBLEM
-----------------------------------------------------------
Is there a way to open a DSN and an Access database simultaneously? Any help you could provide would really be appreciated.
Thanks!