View Single Post
  #2 (permalink)  
Old April 10th, 2005, 09:25 AM
dalewright22 dalewright22 is offline
Authorized User
 
Join Date: Sep 2004
Location: , , United Kingdom.
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Yeah you have the connection string wrong. It Should be like this:

Dim conn, RS, strSQL
Set conn = Server.CreateObject("ADODB.Connection")
Set RS = Server.CreateObject("ADODB.Recordset")
ConnStr = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("database")
Conn.Open Connstr
strSQL = "SELECT  * FROM tbl;"
rs.open strsql, conn

Or in your case (Cause your open a connection on a remote comp)

Dim Conn, RS
  Set Conn = CreateObject("ADODB.Connection")
  Conn.Provider = "Microsoft.Jet.OLEDB.4.0"
  Conn.Open "\\server\share\file.mdb"
  Set RS = Conn.Execute("SELECT * FROM TABLE")


Cheers

DJWright
Reply With Quote