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

debug "Unterminated string constant "

Status
Not open for further replies.

achai

MIS
May 23, 2000
71
US
erro:<br>Microsoft VBScript compilation error '800a0409' <br><br>Unterminated string constant <br><br>/facilities/iru/company.asp, line 18 <br><br>strSQL = &quot;SELECT * FROM companies BY companyID<br><br>--------------------------------------<br>&lt;%<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'create a connection and a recordset<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Set oConn = Server.CreateObject(&quot;ADODB.Connection&quot;)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Set oRs = Server.CreateObject(&quot;ADODB.Recordset&quot;)<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'** edit the server name and connection details as required **<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;oConn.Open &quot;SERVER=typhon;DATABASE=irutablenew.mdb;&quot;<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'build up an appropriate SQL statement from the parameter values<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;strSQL = &quot;SELECT * FROM companies BY companyID<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Set oRs = oConn.Execute(strSQL)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Do While Not oRs.EOF<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Response.Write &quot;&lt;OPTION&gt;&quot; & oRs.Fields(&quot;companyname&quot;) & &quot;&lt;/OPTION&gt;&quot; & vbcrlf<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;oRs.MoveNext<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Loop<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Set oRs = Nothing<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Set oConn = Nothing<br>&nbsp;&nbsp;&nbsp;%&gt;
 
<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'build up an appropriate SQL statement from the parameter values<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;strSQL = &quot;SELECT * FROM companies BY companyID<br><br><br>problem is with SQL statement, you have not closed the string and use ORDER BY in place of BY: <br><br>use given below string<br><br>strSQL = &quot;SELECT * FROM companies ORDER BY companyID&quot;<br><br>hope this help.<br><br>Anand<br><br>&nbsp;
 
it resolved, but still has erro:<br><br>ADODB.Connection error '800a0e7a' <br>ADO could not find the specified provider.<br><br>it seems can't connect to database.&nbsp;&nbsp;<br>&lt;%<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'create a connection and a recordset<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Set oConn = Server.CreateObject(&quot;ADODB.Connection&quot;)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Set oRs = Server.CreateObject(&quot;ADODB.Recordset&quot;)<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'** edit the server name and connection details as required **<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;oConn.Open &quot;SERVER=typhon;DATABASE=irutablenew.mdb;&quot;<br>.....................<br>server is called typhon. what else i should do to connect database.<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>
 
please include userid and password also, if any.<br><br>oConn.Open &quot;SERVER=typhon;DATABASE=irutablenew.mdb;USERID=;PASSWORD=;&quot;<br><br>if this will not work then also include Provider=OLEDB;<br><br>Hope this will work.<br><br>Anand<br>
 
Hi Achai!

If you have some problems for compose the connection string , there is a little trick for obtein it..
If you have de VB program, use a DataControl component in a form, and access to the properties window. You must indicate the database name that you want to connect, and the provider that you want to use (ODBC, OLEDB,...)

If you look in the differents tabs of the window you will find a text field where the connection string is composed, copy it and paste inside your programs.

Try it !

Regards.

Jordi
 
still has erro:<br><br>ADODB.Connection error '800a0e7a' <br>ADO could not find the specified provider. <br>
 
It seems you machine has not OLEDB provider. but its pretty common one.<br><br>Anyway try out this:<br>&nbsp;<br>oConn.Open &quot;Driver={Microsoft Access Driver (*.mdb)};SERVER=typhon;DATABASE=irutablenew.mdb;USERID=;PASSWORD=;&quot;<br><br>if this not working then give absolute path of .mdb file e.g. c:/folder/ggg.mdb<br><br>if this also not working then open ODBC DSN connection&nbsp;&nbsp;from control panel and use that new connection.<br><br>Anand Mishra
 
still shows <br>&quot;ADODB.Connection error '800a0e7a' <br>ADO could not find the specified provider. &quot;<br><br>What's ODBC DSN connection? I can revise this code as coldfusion and use coldfusion server to connect database. but i don't know how to connect database with ASP.<br>
 
I am unable to understand why it is not working in your m/c.<br><br>1. Where you kept your .mdb file? <br>2. Is it mapped in PWS or IIS?<br>3. From where you are running your ASP page means absloute path like c:/nnnn/kkk.asp or <A HREF=" TARGET="_new"> can set DSN(data source name from ODBC set up from control panel for specific database) but last time i gave default driver name for Access that comes with Win95/98/nt os.<br><br>i am sorry i don't have much knowledge of coldfusion? but ASP supports only IIS server.<br><br>Anand<br>&nbsp;
 
1. Where you kept your .mdb file? <br><br>on server<br><br>2. Is it mapped in PWS or IIS?<br><br>no. but how. I only know how to map it with coldfusion server. <br><br>3. From where you are running your ASP page means absloute path like c:/nnnn/kkk.asp or <A HREF=" TARGET="_new"> HREF=" TARGET="_new">
 
Please go through documentation of server wheather it supports ASP or not?<br><br>I am sorry i don't know much about this server.<br><br>Anand<br><br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top