SunQuest
           Database Management
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesDatabase Management

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today!
  #1  
Old July 15th, 2003, 03:44 PM
jharber15 jharber15 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 41 jharber15 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
DAODB problems in Access

I am attempting to access a database while coding in VBA in Access. My declarations are,

Dim sDatabase As String
Dim daoDB As Database
Dim daoRS As Recordset


The actual code that I'm using is,



Private Sub cmdOpen_Click()
Dim fField As Field

sDatabase = "C:\Documentation\HL7\Bedtracking Transactions Maker.mdb"
Set daoDB = OpenDatabase(sDatabase)
Set daoRS = daoDB.OpenRecordset("SELECT * FROM Transactions")

daoRS.MoveFirst
While Not daoRS.EOF
'Some Function
MsgBox daoRS.Fields(0).Value
MsgBox daoRS.Fields(1).Value
MsgBox daoRS.Fields(2).Value
MsgBox daoRS.Fields(3).Value
MsgBox daoRS.Fields(4).Value
MsgBox daoRS.Fields(5).Value
MsgBox daoRS.Fields(6).Value
MsgBox daoRS.Fields(7).Value
MsgBox daoRS.Fields(8).Value
MsgBox daoRS.Fields(9).Value
MsgBox daoRS.Fields(10).Value
MsgBox daoRS.Fields(11).Value

daoRS.MoveNext
Wend
End Sub


Is there any reason that this should not work? The error that I am getting is definitely from the declaration. If i remove the declarations, the application runs ok. The error makes me unable to run any aspect of the form that i'm creating. Any help would be greatly appreciated since I'm a VB noob.

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesDatabase Management > DAODB problems in Access


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway