Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 SQL server to VB interface

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2002-02-08 : 10:31:34
kosh writes "I have interfaced SQL server and JAVA. I would want to know how does one do it through VB. Any sample code will be gratefully appreciated.
kosh."

robvolk
Most Valuable Yak

15732 Posts

Posted - 2002-02-08 : 10:33:21
Hell, if you've done that, VB will be a cinch!

Check out ASP sites:

www.4guysfromrolla.com
www.15seconds.com
www.asp101.com
www.learnasp.com
www.aspalliance.com

There are TOO MANY examples of how to interface with databases. Most of the code is in VBScript, and can be converted to VB with no problem.

Go to Top of Page

KnooKie
Aged Yak Warrior

623 Posts

Posted - 2002-02-08 : 10:37:18
You could use a class to connect to SQL Server from VB...this assumes a DSN though which is best avoided unless circumstances don't allow. e.g. time to change


Private cnn1 As Connection

Private msDSN As String
Private msUserID As String
Private msPassword As String

Public Property Let DSN(thisDSN As String)
msDSN = thisDSN
End Property

Public Property Get DSN() As String
DSN = msDSN
End Property

Public Property Let UserID(thisUserID As String)
msUserID = thisUserID
End Property

Public Property Get UserID() As String
UserID = msUserID
End Property

Public Property Let Password(thisPassword As String)
msPassword = thisPassword
End Property

Public Property Get Password() As String
Password = msPassword
End Property

Public Sub connect()

Set cnn1 = New Connection
cnn1.ConnectionString = "Data Source=" & msDSN & ";user ID=" & msUserID & ";password=" & msPassword
cnn1.Open

End Sub

Go to Top of Page
   

- Advertisement -