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.
| 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.comwww.15seconds.comwww.asp101.comwww.learnasp.comwww.aspalliance.comThere 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. |
 |
|
|
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 changePrivate cnn1 As ConnectionPrivate msDSN As StringPrivate msUserID As StringPrivate msPassword As StringPublic Property Let DSN(thisDSN As String) msDSN = thisDSNEnd PropertyPublic Property Get DSN() As String DSN = msDSNEnd PropertyPublic Property Let UserID(thisUserID As String) msUserID = thisUserIDEnd PropertyPublic Property Get UserID() As String UserID = msUserIDEnd PropertyPublic Property Let Password(thisPassword As String) msPassword = thisPasswordEnd PropertyPublic Property Get Password() As String Password = msPasswordEnd PropertyPublic Sub connect()Set cnn1 = New Connectioncnn1.ConnectionString = "Data Source=" & msDSN & ";user ID=" & msUserID & ";password=" & msPasswordcnn1.OpenEnd Sub |
 |
|
|
|
|
|