Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingVisual Basic Programming

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 ASP Free Forums Sponsor:
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  
Old August 19th, 2004, 08:55 AM
lvfrenchflair lvfrenchflair is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Aug 2004
Posts: 5 lvfrenchflair User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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

Reply With Quote
  #2  
Old August 19th, 2004, 06:17 PM
Doug G Doug G is offline
Grumpier Old Moderator
ASP Free God 11th Plane (10000 - 10499 posts)
 
Join Date: Sep 2003
Posts: 10,143 Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 3 Weeks 4 Days 19 h 13 m
Reputation Power: 180
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

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingVisual Basic Programming > Access through VB6


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 6 hosted by Hostway