Question Locked

SQL

0 helpful
4 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I need to connect SQL Server with the front-end VB 6.0.
Plz. help me And Send the Coding of connectivity SQL SERVER with VB 6.0.

4 replies

by scott_heath

Search 'visual basic 6 sql' and you'll find lots of sample code.

by maniacman

Have you tried reading the manual, even a small portion of it, to see if the solution to your problem is in there?

by ignacem

'VB Code for Connectting sql Database
Dim ObjCnn As ADODB.Connection
Dim StrCnn as String
Private Sub Form_Load()
StrCnn = "Provider=SQLOLEDB.1;Password=kullu;Persist Security Info=True;User ID=kullu;Initial Catalog=InventoryKullu;Data Source=accounts"
'See note

Set ObjCnn = New ADODB.Connection
With ObjCnn
.ConnectionString = StrCnn
.ConnectionString = StrInsertAccess
.Open
.CursorLocation = adUseClient
End With

end sub()
'END OF CODE
note - if password/user id does not exists set "Security Info=false"

Initial Catalog is database name in the sql server database

data source is sql server name
you may create record set object and use sql quarry to retrieve record(s)

This discussion is closed to new replies.