Remote access DB 
Author Message
 Remote access DB

I'm new to VB and doing a club management system group project which
involves ticketing, reservation, accounting etc.
I'm very unsure how does VB take care of the networking to access data on a
Do we have to interface the program with the network hardware directly? or
is it taken care by the OS (Win NT/98)??

Sat, 08 Nov 2003 10:35:39 GMT  
 Remote access DB
You can simply create a Global variable, such as gloDataPath As String, and in
Sub Main() you can read in from a registry setting with GetSetting(<parameter
list>) and populate the variable that way.  Then, whenever you need to access
the database, like when you open it in Sub Main, you could use some code like
the following:

Global wsMain As Workspace
Global dbMain As Database
Global rsAuthors As Recordset
Global gloDataPath As String
Sub Main()
     'Get the network path name from the registry
     gloDataPath = GetSetting(App.Name, "Data", "Path", _                      
     'Set the global workspace object to the default workspace
     set wsMain = DBEngine.Workspaces(0)
     'Open the database
     set dbMain = wsMain.OpenDatabase(gloDataPath & "\" & _
     'Open the "Authors" table
     set rsAuthors = dbMain.OpenRecordset("Authors")

     'Show the main form
End Sub

The above example assumes that the path to the database was saved to the
registry using the SaveSetting function, or that you created the key and the
section in the registry, manually, under the key "HKEY_CURRENT_USER\Software\VB
and VBA Program Settings".  That is where VB saves settings to with
SaveSetting() and retrieves settings from with GetSetting().  If you have any
other questions, don't hesitate to email me.

Sat, 08 Nov 2003 14:17:35 GMT  
 [ 2 post ] 

 Relevant Pages 

1. VB and remote Access DB

2. Performance considerations- Remote Access DB - VB3 or VB4

3. access to a remote DB

4. Remote DB access problems

5. Remote connection to Access 2000 DB

6. VB Accessing db on remote server - how?

7. Convert Access 97 db to Access 2000 db in VB6

8. Attaching Access Db files to Access DB

9. Visual Basic App using Foxpro DB vs Access DB vs SQL Server DB

10. Visual Basic App using Foxpro DB vs Access DB vs SQL Server DB

11. Converting Access 2.0 DB to Access 97 DB in VB code

12. accessing remote resources on a remote computer


Powered by phpBB® Forum Software