|
-
How to update data in Datagrid
I populate my DataGrid with a reference ADO and SQL-Server.
This code update only the visible part of my datagrid. So if the user fill
the last row and then click on the Update Button, nothing happen!!!
Anyone have an idea?
This is my code:
Dim intCtr As Integer
Dim strSql As String
Dim cmdVisiteur As ADODB.Command
Set cmdVisiteur = New ADODB.Command
cmdVisiteur.ActiveConnection = CnConnection
cmdVisiteur.CommandType = adCmdText
With dgProspection
For intCtr = 0 To .ApproxCount - 1
On Error GoTo ErrHandler
.Row = intCtr
If .Columns(3).Text <> "" Then
strSql = "INSERT INTO visiteursite (dnsipvisiteur,
nomvisiteur, destyporg, nompays," & _
"nomprovince) SELECT DnsIp, NomVisiteur, TypeOrg, NomPays,
NomProvince" & _
" FROM " & strVisiteurSite & " WHERE dnsip = " & "'"
& Trim(.Columns(0).Text) & "'"
cmdVisiteur.CommandText = strSql
cmdVisiteur.Execute
End If
Next
End With
Adodc1.Refresh
frmResolution.Caption = "Résolution. (" & Adodc1.Recordset.AbsolutePosition
& "/" & Adodc1.Recordset.RecordCount & ")"
ErrHandler:
MsgBox Err.Description
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks