bloke
06-30-2003, 07:20 AM
Hi
Having difficulty with adding an MS Access database to sqlserver 2000 as a linked server.
Well, that's not strictly true! I have done it and it appears on sqlserver and I can query the tables in query analyser using:
select * FROM OPENQUERY([CRONERS], 'SELECT * FROM TRAINEE')
..and that's fine.
The problem I'm having is querying this in asp. I don't know if I'm barking up the wrong tree but I think my problem may be to do with DSN's. Please correct me if I'm wrong.
I'm trying this:
gstrConCroners = "DSN=CRONERS"
dim rsX
set rsX = server.CreateObject("ADODB.Recordset")
rsX.Open "select * FROM OPENQUERY([CRONERS], 'SELECT * FROM TRAINEE')", gstrConCroners
response.write rsX.fields("forename") & " " & rsX.fields("surname")
response.end
but it falls over on the rsX.Open line with the following error:
Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC Microsoft Access Driver] '(unknown)' is not a valid path. Make sure that the path name is spelled correctly and that you are connected to the server on which the file resides.
I'm lost. Please help!
Cheers
Having difficulty with adding an MS Access database to sqlserver 2000 as a linked server.
Well, that's not strictly true! I have done it and it appears on sqlserver and I can query the tables in query analyser using:
select * FROM OPENQUERY([CRONERS], 'SELECT * FROM TRAINEE')
..and that's fine.
The problem I'm having is querying this in asp. I don't know if I'm barking up the wrong tree but I think my problem may be to do with DSN's. Please correct me if I'm wrong.
I'm trying this:
gstrConCroners = "DSN=CRONERS"
dim rsX
set rsX = server.CreateObject("ADODB.Recordset")
rsX.Open "select * FROM OPENQUERY([CRONERS], 'SELECT * FROM TRAINEE')", gstrConCroners
response.write rsX.fields("forename") & " " & rsX.fields("surname")
response.end
but it falls over on the rsX.Open line with the following error:
Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC Microsoft Access Driver] '(unknown)' is not a valid path. Make sure that the path name is spelled correctly and that you are connected to the server on which the file resides.
I'm lost. Please help!
Cheers