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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Doubts about strings

Status
Not open for further replies.

EvertonFC

Technical User
Nov 24, 2004
107
GB
Hello

I have two files which connect to my MS Access database. These are connDUfaq.asp and connDUfaqAdmin.asp. These are the only two files (of several), which connect to the database.

The connection to the database (in both above files) is:

<%
' FileName="Connection_odbc_conn_dsn.htm"
' Type="ADO"
' HTTP="false"
' Catalog=""
' Schema=""

MM_connDUfaq_STRING = "DRIVER={Microsoft Access Driver
(*.mdb)};DBQ=D:\business\abc.com\private\DUfaq.mdb;"

%>

Another, linking, file is default.asp which, when I try to open it, gives the following error:

Microsoft VBScript compilation error '800a0409'

Unterminated string constant

/faq/Connections/connDUfaq.asp, line 8

MM_connDUfaq_STRING = "DRIVER={Microsoft Access Driver
------------------------------------------------------^

I am not sure if this is a concatination issue, but would still appreciate some guidance, please.

Cheers

EvertonFC
 
The error message is correct, there is an Un-Terminated String Constant.

It is complaining about these two lines:[tt]
MM_connDUfaq_STRING = "DRIVER={Microsoft Access Driver
(*.mdb)};DBQ=D:\business\abc.com\private\DUfaq.mdb;"[/tt]

They should clearly actually be ONE line ... but there is a carriage return or linefeed or both stuck in the middle.

The VBScript parser is seeing the first line as having a string that starts with a double-quote character but does not also end with one.

So either make it all one line by removing the return char(s) or use the standard VBScript notation for continuing beyond a line:[tt]
MM_connDUfaq_STRING = "DRIVER={Microsoft Access Driver " _
& "(*.mdb)};DBQ=D:\business\abc.com\private\DUfaq.mdb;"
[/tt]
 
Sheco meant this one...

Code:
MM_connDUfaq_STRING = "DRIVER={Microsoft Access Driver[red]"& _ [/red]
[red]"[/red](*.mdb)};DBQ=D:\business\abc.com\private\DUfaq.mdb;"

-DNG
 
They should be functionally the same...

I just prefer to put the ampersand on the subsequent rows aligned with the equal sign. Its just a quirk I guess.
 
oh did i get an extra space character in there?
 
Many thanks

IU had an idea it was a concatination issue. Many thanks to you both for your explanations as to where the "" go.

Cheers

EvertonFC
 
Ya, i thought you had a big space between the & and quotes...

-DNG
 
oh, thats an artifact of the screen size... copy it out and paste it into notepad and you'll see what i mean.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top