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

Access connect string for ASP page

Status
Not open for further replies.

ITA

Programmer
Nov 9, 1999
18
0
0
US
I am trying to construct a connect string for an access database using ASP. I can not find anything that will provide me with an example and what I have written thus far is not working.<br><br>Here is what I have so far......<br>const cDSN1 =&quot;Driver={Microsoft Access(*.mdb) };DBQ=*******.mdb&quot;<br><br>and the error that I get is Microsoft OLEDB provider for ODBC Driver error 80004005<br>Data source name not found and no default driver specified<br><br>Can anyone provide me with something to try?
 
Why dont u try with odbc..create a odbc connect string an use it in ur ASP,i assume that u know how to connect useing <b>DSN</b>.
 
I do not have physical access to the box, nor do I have remote capabilities. All I can do is access the root to manage my pages. I prefer to use a DSN, however somethings are out of my control and this is one particular instance.
 
DIM ACSCONN<br>SET ACSCONN = SERVER.CREATEOBJECT(&quot;ADODB.CONNECTION&quot;)<br>ACSCONN.CONNECTIONSTRING=&quot;Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\acsoftware2000\Database\ACSVisits.mdb;Persist Security Info=False&quot; <br>ACSCONN.OPEN<br>SET ACSADD= SERVER.CREATEOBJECT(&quot;ADODB.COMMAND&quot;)<br>SET ACSADD.ACTIVECONNECTION = ACSCONN<br><br>ACSADD.COMMANDTEXT = &quot;INSERT INTO ACSVISITS (VDATE,FULLNAME,ADDRESS,CITY,STATE,ZIPCODE,COUNTRY,BUSINESSNAME,BUSINESSDESC,PHONE1,PHONE2,EMAIL,NEEDS) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?)&quot;<br>ACSADD.PARAMETERS.APPEND ACSADD.CREATEPARAMETER(&quot;VDATE&quot;,135, ,8)<br>ACSADD.PARAMETERS.APPEND ACSADD.CREATEPARAMETER(&quot;FULLNAME&quot;,200, ,60)<br>ACSADD.PARAMETERS.APPEND ACSADD.CREATEPARAMETER(&quot;ADDRESS&quot;,200, ,50)<br>ACSADD.PARAMETERS.APPEND ACSADD.CREATEPARAMETER(&quot;CITY&quot;,200, ,30)<br>ACSADD.PARAMETERS.APPEND ACSADD.CREATEPARAMETER(&quot;STATE&quot;,200, ,2)<br>ACSADD.PARAMETERS.APPEND ACSADD.CREATEPARAMETER(&quot;ZIPCODE&quot;,200, ,5)<br>ACSADD.PARAMETERS.APPEND ACSADD.CREATEPARAMETER(&quot;COUNTRY&quot;,200, ,30)<br>ACSADD.PARAMETERS.APPEND ACSADD.CREATEPARAMETER(&quot;BUSINESSNAME&quot;,200, ,40)<br>ACSADD.PARAMETERS.APPEND ACSADD.CREATEPARAMETER(&quot;BUSINESSDESC&quot;,200, ,50)<br>ACSADD.PARAMETERS.APPEND ACSADD.CREATEPARAMETER(&quot;PHONE1&quot;,200, ,15)<br>ACSADD.PARAMETERS.APPEND ACSADD.CREATEPARAMETER(&quot;PHONE2&quot;,200, ,15)<br>ACSADD.PARAMETERS.APPEND ACSADD.CREATEPARAMETER(&quot;EMAIL&quot;,200, ,60)<br>ACSADD.PARAMETERS.APPEND ACSADD.CREATEPARAMETER(&quot;NEEDS&quot;,200, ,200)<br>ACSADD(&quot;VDATE&quot;) = NOW<br>ACSADD(&quot;FULLNAME&quot;) = REQUEST(&quot;FULLNAME&quot;)<br>ACSADD(&quot;ADDRESS&quot;) = REQUEST(&quot;ADDRESS&quot;)<br>ACSADD(&quot;CITY&quot;) = REQUEST(&quot;CITY&quot;)<br>ACSADD(&quot;STATE&quot;) = REQUEST(&quot;STATE&quot;)<br>ACSADD(&quot;ZIPCODE&quot;) = REQUEST(&quot;ZIPCODE&quot;)<br>ACSADD(&quot;COUNTRY&quot;) = REQUEST(&quot;COUNTRY&quot;)<br>ACSADD(&quot;BUSINESSNAME&quot;) = REQUEST(&quot;BUSINESSNAME&quot;)<br>ACSADD(&quot;BUSINESSDESC&quot;) = REQUEST(&quot;BUSINESSDESC&quot;)<br>ACSADD(&quot;PHONE1&quot;) = REQUEST(&quot;PHONE1&quot;)<br>ACSADD(&quot;PHONE2&quot;) = REQUEST(&quot;PHONE2&quot;)<br>ACSADD(&quot;EMAIL&quot;) = REQUEST(&quot;EMAIL&quot;)<br>ACSADD(&quot;NEEDS&quot;) = REQUEST(&quot;NEEDS&quot;)<br>ACSADD.EXECUTE<br>SET ACSADD = NOTHING<br>SET ACSCONN=NOTHING
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top