|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Ajax Application Generator Generate database and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
|
|
#1
|
|||
|
|||
|
Access through VB6
This must be one of the most asked subjects in the world but I just can't seem to get it to work!
I'm trying to get some data from an Access database into VB6, the code I'm using is below. For some reason it doesn't like the term "OpenDatabase". I'd be most grateful if someone could point out where I've made a mistake or how I can get it to work! Thank you! Code:
Private Sub GetStageData1()
Dim rsStage As Recordset
Dim strSQL As String
Dim i As Integer
Set dbDatabaseName = OpenDatabase("C:\Documents and Settings\LONMA6\My Documents\Admin\H.I.P.P.O\Testing\190804\StageReco rds.mdb")
strSQL = "SELECT * FROM Stages"
Set rsStage = dbDatabaseName.OpenRecordset(strSQL)
rsStage.MoveLast
StageRecCount = rsStage.RecordCount
rsStage.MoveFirst
ReDim Stage(1 To StageRecCount)
For i = 1 To StageRecCount
With Stage(i)
.srStage = rsStage.Fields("Stage").Value
.srStart = rsStage.Fields("Start").Value
.srDuration = rsStage.Fields("Duration").Value
End With
rsStage.MoveNext
Next i
End Sub
|
|
#2
|
|||
|
|||
|
You're using DAO it seems, and maybe you don't have a reference to the correct DAO library in your VB project.
__________________
====== Doug G ====== I didn't attend the funeral, but I sent a nice letter saying I approved of it. --Mark Twain |
![]() |
| Viewing: ASP Free Forums > Programming > Visual Basic Programming > Access through VB6 |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|