DB connection to access 2000

Results 1 to 2 of 2

Thread: DB connection to access 2000

  1. #1
    Rodney Kesselring Guest

    Default DB connection to access 2000

    Does anyone know the dns-less connection string for an access 2000 DB? I had read somewhwere that it would be different that an access 97 DB.

  2. #2
    Join Date
    Dec 1969

    Default RE: DB connection to access 2000

    I think it&#039s the same as with access &#039 97, but as I&#039ve been having good luck with subroutines lately, here&#039s the connection string I&#039m using now for DSN&#039less access.<BR><BR>&#060;%<BR>&#039DECLARE VARIABLES FOR DATABASE CALL<BR>dim MyConn, MdbFilePath, SQL_query, RS<BR>&#039OPEN THE DATABASE AND CALL RECORDS<BR>Sub openDB(DBquery)<BR> Set MyConn = Server.CreateObject("ADODB.Connection")<BR> MdbFilePath = Server.MapPath("yourdb.mdb")<BR> MyConn.Open "Driver={Microsoft Access Driver (*.mdb)}; DBQ=" & MdbFilePath & ";"<BR> SQL_query =(DBquery)<BR> Set RS = MyConn.Execute(SQL_query)<BR>End Sub<BR>Sub shutDB<BR>&#039FINISH UP AND CLOSE THE DATABASE<BR> RS.Close<BR> MyConn.Close<BR> Set RS = Nothing<BR> Set MyConn = Nothing<BR>End Sub<BR>%&#062;<BR><BR>then down further on the page where you want your stuff, you use the following code:<BR><BR>&#060;%<BR>Call openDB ("SELECT * FROM yourtable WHERE ID= " & pageID)<BR>WHILE NOT RS.EOF<BR>%&#062;<BR> <BR> &#060;p&#062;&#060;%=RS("Fieldname")%&#062;<BR> <BR>&#060;%<BR>RS.MoveNext<BR>WEND<BR>Call shutDB<BR>%&#062;

Posting Permissions

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