By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,057 Members | 1,407 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,057 IT Pros & Developers. It's quick & easy.

connect to a website database from vb application!!

P: 2
hi everybody.
from a [vb6 or vb.net] application i need to connect to a database thet located
in a website!!
now how i connect!
can somebody show me a sample code for it?
Nov 28 '07 #1
Share this Question
Share on Google+
1 Reply


Dököll
Expert 100+
P: 2,364
hi everybody.
from a [vb6 or vb.net] application i need to connect to a database thet located
in a website!!
now how i connect!
can somebody show me a sample code for it?
Greetings and salutations, ghasemabedi!

I can start you off connecting to the site, you 'll need to do some leg work to fit your purpose:

Expand|Select|Wrap|Line Numbers
  1.  
  2. Private Sub LoadMyWebDatabase_Click()
  3.    Dim LoadingIE As Object
  4.    Dim LoadingItem As Object
  5.    Dim LoadingMain As Object
  6.  
  7. 'Making it happen here, building IE session.
  8.    Set LoadingIE = CreateObject("internetexplorer.application")
  9.  
  10. 'Loading URL of your database.
  11.   LoadingIE.Navigate ("www.YourDatabase.com")
  12.  
  13. 'Here's a chance to wait for YourDatabase to load.
  14.    Do While (LoadingIE.ReadyState <> 4)
  15.    Loop
  16.  
  17. 'Here's a chance to manage the main item.
  18.    Set LoadingItem = LoadingIE.Document
  19.  
  20. 'Here's a chance to manage the main object.
  21.    Set LoadingMain = LoadingItem.Body
  22.  
  23. 'You can remove this to load site straight away...
  24.    If (MsgBox("Would you like to load YourDatabase on the web?", _
  25.    vbQuestion + vbYesNo, "Loading YourDatabase!") = vbYes) Then
  26.  
  27. 'Loading your wonderful database
  28.    LoadingIE.TheaterMode = True
  29.    LoadingIE.TheaterMode = False
  30.    Else
  31.  
  32.  
  33. 'Close your database and call it a day...
  34.    LoadingIE.quit
  35.  
  36.    End If
  37.  
  38. End Sub
  39.  
  40.  
that oughta do it;-)

Please stay tuned for added support, if needed.

Good luck and welcome!

Dököll
Nov 29 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.