This code is used to connect to sqlserver using ADO code and access the data on the SQLServer.
This code is used to connect to sqlserver using ADO code and access the data on the SQLServer.
API Declarations
Dim rs As ADODB.Recordset
Rate This code is used to connect to sqlserver using ADO code and access the data on the SQLServer.
(1(1 Vote))
Private Sub Form_Load()
Set cnn = New Connection
Set rs = New Recordset
With cnn
.Provider = "sqloledb"
.ConnectionString = "user id=username;,data source=databasename;initial catalog=databasename"
.Open
End With
rs.Open "select * from tablename", cnn
Call display
End Sub
****--- Create a function that displays the records after connection is established -- -***
Sub display()
txtcid = rs!custid
txtname = rs!Custname
txtadd = rs!address
txtph = rs!phone
End Sub
This code is used to connect to sqlserver using ADO code and access the data on the SQLServer. Comments
No comments yet — be the first to post one!
Post a Comment