If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > Invalid character on dsn-less connection to Access

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-26-04, 17:23
karizmatic karizmatic is offline
Registered User
 
Join Date: Mar 2004
Location: los angeles
Posts: 10
Invalid character on dsn-less connection to Access

I have set up a connection to a database on a sharepoint that looks exactly like this (I've removed the path for brevity):

Code:
<%
Set connPSC = Server.CreateObject("ADODB.Connection")
connPSC.Open (Driver={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("\\path"))
%>
I also created a page that tests this connection (simple query that returns ONE record). When I try to run the test page, I get the following error:

Code:
Microsoft VBScript compilation error '800a0408' 

Invalid character 

/isreports/sc/connPSC.inc, line 5 

connPSC.Open (Driver={Microsoft Access Driver (*.mdb)};DBQ=" &_
---------------------^
I actually copied this from one of the hundreds of examples out there for connecting dsn-less to an Access database... I'm not sure why my brackets are being interpreted as invalid. I also tried it without the brackets, but then it expects the close parenthesis right after the string "Microsoft"... any ideas?
Reply With Quote
  #2 (permalink)  
Old 04-26-04, 22:55
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
try this....

connPSC.Open ("Driver={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("\\path"))

Note the first set of quotes
Reply With Quote
  #3 (permalink)  
Old 04-27-04, 18:49
Bullschmidt Bullschmidt is offline
Guru
 
Join Date: Jun 2003
Location: USA
Posts: 1,032
Here's a good connections resource, and it's advised that you use Jet instead of Microsoft Access for the DSN-less connection to an Access database:

Able Consulting - ADO Connection String Samples
http://www.able-consulting.com/ADO_Conn.htm
__________________
J. Paul Schmidt, Freelance Web and Database Developer
www.Bullschmidt.com
Access Database Sample, Web Database Sample, ASP Design Tips
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On