Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ASP Connection to Query with Linked table

Status
Not open for further replies.

Catbird45

Programmer
Jan 25, 2005
1
US
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 OLEDB:Database 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
rsProdInfo_Open 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!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top