Connection String

Results 1 to 3 of 3

Thread: Connection String

  1. #1
    New User Guest

    Default Connection String

    Hi, I&#039;m new to asp and I was wondering if you could help me make a connection to a database.<BR>The code I&#039;m using is as follows:<BR><BR>Dim EmpInfoDSN<BR>Dim objConnection<BR><BR>EmpInfoDSN = "DSN=employees.mdb;uid=;password="<BR>Set objConnection = Server.CreateObject("ADODB.Connection")<BR>objConn ection.Open EmpInfoDSN<BR><BR>The database is sitting in the same folder as the page where this code lies. Its a MS Access 97 database. The error is as follows:<BR><BR>Microsoft OLE DB Provider for ODBC Drivers error &#039;80004005&#039; <BR><BR>[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified <BR><BR>Any help greatfully appreciated,<BR>Thank you.<BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default Here you go....

    well you can either use connection less dsn or using dsn<BR><BR>"Provider=Microsoft.Jet.OLEDB.4.0;<BR>D ata Source=c:xxxxxxemployees.mdb"<BR><BR>I think the problem with yours is either the type of the dsn.<BR>Filedsn....<BR><BR>If your database is on the same can use the above code , just put the approriate path.<BR><BR>I hope this helps <BR><BR>jpn

  3. #3
    Join Date
    Dec 1969

    Default RE: Connection String

    Try this<BR><BR>Set objconnection=Server.CreateObject("ADODB.Connectio n")<BR>objconnection.ConnectionString="DRIVER={Mic rosoft Access (*.Mdb)};DBQ=employees.Mdb;"<BR>objconnection.Open

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts