2 Replies - 3147 Views - Last Post: 20 October 2009 - 05:29 AM Rate Topic: -----

#1 k4t1kai  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 19-October 09

Can VB6 access remote database?

Posted 19 October 2009 - 06:34 PM

I have to know that can VB6 able to access remote database?
In my project I want to establish Client-Server hierarchy.
The database should be in server and client must be able to view the data.
Is this possible in VB6 ?
I am using MS Access database and VB6
pls tell me how to do this or any link that will help this problem
Thanks in advance

This post has been edited by k4t1kai: 19 October 2009 - 06:35 PM

Is This A Good Question/Topic? 0
  • +

Replies To: Can VB6 access remote database?

#2 vb5prgrmr  Icon User is offline

  • D.I.C Lover

Reputation: 109
  • View blog
  • Posts: 1,016
  • Joined: 21-March 09

Re: Can VB6 access remote database?

Posted 19 October 2009 - 10:18 PM

Yes
Yes
Data Form Wizard, http://www.connectionstrings.com, search for vb6 ADO Tutorial using one of your friends (yahoo, google, ask, answers, bing) or just to the right of these posts see if there is one on this site if you happen to see the section to the right that says VB Tutorials...



Good Luck
Was This Post Helpful? 0
  • +
  • -

#3 Philip Munce  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 4
  • Joined: 14-October 09

Re: Can VB6 access remote database?

Posted 20 October 2009 - 05:29 AM

www.connectionstrings.com should be your place to go. The way I would typically approach it is to add a reference to the Microsoft ActiveX Data Objects library (ADO) to the project I am working on. I have added a screen dump below. This will then allow me to create code similar to the following to connect to a database and read fields out.


Dim conn As New ADODB.Connection
Dim results As ADODB.Recordset
Dim value As Integer

	conn.Open "<insert conn string here>"
	Set results = conn.Execute("SELECT FIELD FROM TABLE")
	
	results.MoveFirst
	While Not results.EOF
		
		value = results("FIELD")
		
		results.MoveNext
		
	Wend
	
	results.Close
	conn.Close




(It's been a while since I've used ADO so make sure you read up on it)

Attached image(s)

  • Attached Image

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1