OLEDB problems

Results 1 to 4 of 4

Thread: OLEDB problems

  1. #1
    Join Date
    Dec 1969
    Posts
    8

    Default OLEDB problems

    I&#039ve recently read an article posted here about OLEDB, but I can&#039t get it to work for me. <BR><BR>Does anybody have an example script or page that uses OLEDB to connect to an Access database?<BR><BR>Thanks in advance!<BR><BR>Aloha,<BR>Scott

  2. #2
    Join Date
    Dec 1969
    Posts
    2,849

    Default RE: OLEDB problems

    Here is a script that works fine for me. It connects to the Northwinds database:<BR><BR>What error(s) are you getting? What seems not to be working?<BR><BR>&#060;%@ Language=VBScript &#037;&#062;<BR>&#060;%<BR> Dim objConn<BR> Set objConn = Server.CreateObject("ADODB.Connection")<BR> objConn.Open "Provider = Microsoft.Jet.OLEDB.4.0; Data Source =c:InetPubwwwrootadvworks.mdb"<BR> <BR> <BR> Dim objRS<BR> Set objRS = objConn.Execute("SELECT * FROM Customers")<BR> &#039objRS.Open "SELECT * FROM tblState",objConn<BR>&#037;&#062;<BR><BR>&#060;HTM L><BR>&#060;BODY><BR><BR>&#060;%<BR> Dim i<BR> <BR> Do While Not objRS.EOF<BR> For i = 0 to objRS.Fields.Count - 1<BR> Response.Write objRS(i).Name & ": " & objRS(i) & "<BR>"<BR> Next<BR> Response.Write "&#060;P>&#060;HR>&#060;P>"<BR> objRS.MoveNext<BR> Loop<BR>&#037;&#062; <BR><BR>&#060;/BODY><BR>&#060;/HTML><BR><BR>&#060;%<BR> objRS.Close<BR> Set objRS = Nothing<BR><BR> objConn.Close<BR> Set objConn = Nothing<BR>&#037;&#062;

  3. #3
    Join Date
    Dec 1969
    Posts
    2,849

    Default RE: OLEDB problems

    Oh, also, you need to be using ADO 2.0 or greater. See http://www.microsoft.com/data to get the latest version of ADO if you don&#039t have it...

  4. #4
    Rui de Castro Guest

    Default RE: OLEDB problems

    I got it to work changing the version of the Jet, I had 3.51 (which was given in the exemple in the OLEDB document) and changed it to 4.0<BR>Now it works, but I&#039ve got one question, when I used to establesh a odbc connection, I use to put the threads to 20 and MaxBufferSize to 8192. I once read that this would maximise the performance of the connection. But now with this new way (OLEBD), does it have a way to do this, or it turns it on automaticly?


Posting Permissions

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