DSN-Less Database Connection 
Author Message
 DSN-Less Database Connection

Jonathon,
I use the following code which works for me.  Make sure you have browse rights to the directory where the database resides.
<%

Set CN = Server.CreateObject("ADODB.Connection")

Set RS = Server.CreateObject("ADODB.Recordset")

Dim strConn

strConn = "Provider=Microsoft.Jet.OLEDB.4.0; "

strConn = strConn & "Data Source=c:\inetpub\wwwroot\ocp\sm\fpdb\sm.mdb"

CN.open StrConn

Set RS.ActiveConnection = cn

RS.CursorType = adOpenKeyset

RS.Source = "districts"

RS.Open " select district from districts "

%>

Quote:

> I have an asp page which searches an access database up and running fine

> with a system DSN. But I am having trouble changing it to a DSN-less
> connection. The VBS command and the error I get are listed below:

> Any help would be greatly appreciated.

> ----------------------------------------------------------------------
> ' Open Database Connection
> DBConn.Open "DRIVER={Microsoft Access Driver (*.mdb)};" &_
> "DBQ= c:\Inetpub\wwwroot\civilwar\database\civilwar_images.mdb"
> -----------------------------------------------------------------------

> -----------------------------------------------------------------------
> Microsoft VBScript runtime error '800a01a8'

> Object required: 'DBConn'

> /civilwar/database/search2.asp, line 11
> -----------------------------------------------------------------------



Sun, 29 Jun 2003 04:10:12 GMT  
 DSN-Less Database Connection

Have you had any problems with INSERT commands, like syntax errors?

See my posting "Microsoft.Jet.OLEDB.4.0 Syntax errors, posted Jan 12 2001 6:11pm

--
Yours sincerely
David Martin
Web Developer - FrontPage, ASP, Access
Info Blue Mountains - mountains of Blue Mountains information
http://info.mountains.net.au


  Jonathon,
  I use the following code which works for me.  Make sure you have browse rights to the directory where the database resides.
  <%

  Set CN = Server.CreateObject("ADODB.Connection")

  Set RS = Server.CreateObject("ADODB.Recordset")

  Dim strConn

  strConn = "Provider=Microsoft.Jet.OLEDB.4.0; "

  strConn = strConn & "Data Source=c:\inetpub\wwwroot\ocp\sm\fpdb\sm.mdb"

  CN.open StrConn

  Set RS.ActiveConnection = cn

  RS.CursorType = adOpenKeyset

  RS.Source = "districts"

  RS.Open " select district from districts "

  %>


  > I have an asp page which searches an access database up and running fine
  >
  > with a system DSN. But I am having trouble changing it to a DSN-less
  > connection. The VBS command and the error I get are listed below:
  >
  > Any help would be greatly appreciated.
  >
  > ----------------------------------------------------------------------
  > ' Open Database Connection
  > DBConn.Open "DRIVER={Microsoft Access Driver (*.mdb)};" &_
  > "DBQ= c:\Inetpub\wwwroot\civilwar\database\civilwar_images.mdb"
  > -----------------------------------------------------------------------
  >
  > -----------------------------------------------------------------------
  > Microsoft VBScript runtime error '800a01a8'
  >
  > Object required: 'DBConn'
  >
  > /civilwar/database/search2.asp, line 11
  > -----------------------------------------------------------------------
  >
  >
  >



Wed, 02 Jul 2003 09:14:35 GMT  
 DSN-Less Database Connection
Read the FAQ.

http://www.aspfaq.com/faq/faqShow.asp?fid=45

Enjoy,

Anthony Sullivan MCP, GMT, GST
Analyst/Programmer
Ajilon Services, Inc

Check out the ASP FAQ! http://www.aspfaq.com
"From the mouths of babes comes ... slobber."

Quote:

>I have an asp page which searches an access database up and running fine

>with a system DSN. But I am having trouble changing it to a DSN-less
>connection. The VBS command and the error I get are listed below:

>Any help would be greatly appreciated.

>----------------------------------------------------------------------
>' Open Database Connection
>DBConn.Open "DRIVER={Microsoft Access Driver (*.mdb)};" &_
>"DBQ= c:\Inetpub\wwwroot\civilwar\database\civilwar_images.mdb"
>-----------------------------------------------------------------------

>-----------------------------------------------------------------------
>Microsoft VBScript runtime error '800a01a8'

>Object required: 'DBConn'

>/civilwar/database/search2.asp, line 11
>-----------------------------------------------------------------------



Sun, 06 Jul 2003 00:16:06 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. DSN-Less Database Connection

2. DSN-less database connection

3. DSNless Database Connection

4. Crystal and ODBC DSN/DSN-less connections - do I need USER DSN or SYSTEM DSN

5. performance different between DSN to DSN-Less Connection

6. DSN vs DSN-less connections

7. DSN-less connection string to a remote MS Acess database

8. ADO - DSN less connection to SQL server Database

9. Need Connection string for VB6 DAO DSN-LESS Connections to SQL Server 2000

10. Connection string for DSN-less Informix connection

11. Need Connection string for VB6 DAO DSN-LESS Connections to SQL Server 2000

12. Problem with DSN less connection

 

 
Powered by phpBB® Forum Software