Re: Problems with Connection Strings
- From: "ekkehard.horner" <ekkehard.horner@xxxxxxxx>
- Date: Fri, 15 Jun 2007 12:43:26 +0200
rich schrieb:
Hello Everyone,
I am a newbie to web development. I am using FrontPage 2002/SP3 on XP and IIS 6.0 on Win2K3 server. My Dev website is stored locally and I am publishing to the IIS server.
I am attempting to connect to and query an Access database stored both locally and on the IIS server. This is the code (and connection string that I am using, (which I believe should be using the Microsoft Jet driver, pardon if I am not 100% correct in this statement.)...
<%
dim oConn
dim strConn
dim strSQL
dim rs
Set oConn = CreateObject("ADODB.Connection")
Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Documents and Settings\rks.RPS.002\My Documents\My Webs\richweb\GSDtest\OtherFiles\jettest.mdb
oConn.open strConn
%>
> Set oConn = CreateObject("ADODB.Connection")
strConn = _
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Documents and " _
& "Settings\rks.RPS.002\My Documents\My " _
& "Webs\richweb\GSDtest\OtherFiles\jettest.mdb"
> oConn.open strConn
check "\My Webs\" or "\MyWebs\" and keep or delete the space in line 4
[...]
When I run this page on the IIS server, I get the following error message:
Microsoft VBScript compilation error '800a0401' Expected end of statement /GSDtest/Jet.asp, line 8 Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Documents and Settings\rks.RPS.002\My Documents\My Webs\richweb\GSDtest\OtherFiles\jettest.mdb
----------------------------^
The ^ character is pointing to the "." (period) after OLEDB and before the number 4. Can anyone tell me why I am having this problem and how to resolve it?
VBscript thinks,
Provider=Microsoft.Jet.OLEDB.4
is an assignment to a variable Provider and tries to use a method
called 4 of the (complex) object Microsoft.Jet.OLEDB to get the value
to assign. But 4 isn't a valid name (should start with a letter). Instead
of giving a reasonable error message VBScript defaults to his/her/its
standard tactic of picking a random one.
.
- Prev by Date: write to eventlog or filesystem on remote machine in system context
- Next by Date: Assigning variable output of %comspec%
- Previous by thread: Re: Problems with Connection Strings
- Next by thread: registry keys to treeview control
- Index(es):
Relevant Pages
|