Setting a DNSLess connections Cursor value

Results 1 to 2 of 2

Thread: Setting a DNSLess connections Cursor value

  1. #1
    Join Date
    Dec 1969
    Posts
    511

    Default Setting a DNSLess connections Cursor value

    As inspired by this mornings 4 G.F.R. email, I want to create a static DNS-less connection so I have access to the RecordCount, but I&#039m having trouble. Can any one give me some pointers as to how it should be done?<BR><BR>Set MyConn=server.createobject("ADODB.connection")<BR> MyPath="DBQ=" & server.mappath(" emp estfile.mdb")<BR>MyConn.Open "DRIVER=[Microsoft Access Driver(*.mdb)}; " & MyPath, 3 &#039This is my guess as it how to do it.<BR><BR>Set MyRS=MyConn.execute("SELECT * FROM MyTable")<BR><BR>...<BR><BR>Ta,<BR><BR>Pete

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

    Default RE: Setting a DNSLess connections Cursor value

    You are going to have to explicitly create your recordset object, then explicitly tell it to be a cursor that supports forward and backward movement (the default cursor is a firehouse cursor, one that allows only forward movement through the cursor. If you implicitly create a recordset object (i.e. Set rs = objConn.Execute(strSQL)), then it assigns the recordset object the default, forward-only cursor).<BR><BR>There&#039s a helpful article on 4Guys. These two articles should get you on your way:<BR><BR>(Talks about forward-only cursors, and shows how you implicitly create a recordset object, and what types of cursors there are)<BR>http://www.4guysfromrolla.com/webtech/112998-1.shtml<BR><BR>and<BR><BR>(Talks about explicitly creating a recordset object and how to iterate through a recordset object)<BR>http://www.4guysfromrolla.com/webtech/faq/Databases/faq4.shtml<BR><BR>Happy Programming!

Posting Permissions

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