Computing.Net > Forums > Programming > VB6.0 and SQL server & windows comp

Computing.Net: Over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to sign up now, it's free!

VB6.0 and SQL server & windows comp

Reply to Message Icon

Original Message
Name: Sstan
Date: August 20, 2003 at 10:13:25 Pacific
Subject: VB6.0 and SQL server & windows comp
OS: XP Home edition
CPU/Ram: 512
Comment:

Hi Guys,
I am new to windows programing, and my computer is running Windows XP Home Edition.
Would somebody tell me how to connect from VB6.0 to SQL Server 2000, and if it's possible, then where I can download for free windows component update for VS.NET?

Stan


Report Offensive Message For Removal


Response Number 1
Name: Chi Happens
Date: August 20, 2003 at 11:29:47 Pacific
Reply: (edit)

I have answered this question about a hundred times (I wish this forum was easier to search, or organized better)... anyhow:

It is possible, simply use the ADODB objects.

Dim CN As ADODB.Connection
Dim RS As ADODB.RecordSet

Set CN = New ADODB.Connection
Set RS = New ADODB.RecordSet

SQL = "SELECT * FROM MyTable"

CN.Open "Driver={SQL Server};USR=username;PWD=Password;Databse=DatabaseName"

RS.Open SQl, CN

Do While RS.EOF = False
    ' Do Something
    RS.MoveNext
Loop

RS.Close
CN.Close
Set RS = Nothing
Set CN = Nothing


Report Offensive Follow Up For Removal







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home








Do you have your own blog?

Yes
No
I did before
I will soon


View Results

Poll Finishes In 4 Days.
Discuss in The Lounge
Poll History




Data Recovery Software