Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL Server Insert/update
Message
Information générale
Forum:
Visual Basic
Catégorie:
SQL Server
Divers
Thread ID:
00506187
Message ID:
00506205
Vues:
26
Hi Eric,

Updating, Inserting data from VB.

This Code let me connect to the SQL server. I can read data from SQL Server, but addnew,update dosen't work. How can I do insert and update records?


Dim conn As New ADODB.Connection
Dim cmd As New ADODB.Command
Dim rs As ADODB.Recordset
Dim sConnString As String
Dim iCtr As Integer

'connection string for SQl server
sConnString = "Provider=SQLOLEDB.1;user ID=qcafsl;password=magic;Initial Catalog=EmpAnnual;Data Source = Intranet;Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4096"
conn.Open sConnString
Set cmd.ActiveConnection = conn

cmd.CommandText = "SELECT * FROM Assessment"
cmd.CommandType = adCmdText
Set rs = cmd.Execute


Thank you
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform