Hi,
I'm connecting to a sql-server database using VB6. I've added a datagrid which displays records from one of the tables within the database.
Unfortunatly I can't seem to update any of the information being displayed in the datagrid.
I am using the following code to connect to the sql-server database:
ConnectString = "DSN=LondonDB;" & "UID=user1;PWD=hello;" & "DATABASE=LondonDB"
and the following code to get the data from table Sales into the datagrid.
Dim rempRS As Recordset
strsql = "SELECT * from Sales"
Set tempRS = New Recordset
tempRS.Open strsql, goConn, adOpenKeyset, adLockPessimistic, adCmdText
DataGrid1.Visible = -1
Set DataGrid1.DataSource = tempRS
DataGrid1.Refresh
The property AllowUpdate for the datagrid is set to True.
Can anyone tell me what I need to do to allow changes to be made to table Sales directly via the DataGrid ?
Thanks,
Moben
I'm connecting to a sql-server database using VB6. I've added a datagrid which displays records from one of the tables within the database.
Unfortunatly I can't seem to update any of the information being displayed in the datagrid.
I am using the following code to connect to the sql-server database:
ConnectString = "DSN=LondonDB;" & "UID=user1;PWD=hello;" & "DATABASE=LondonDB"
and the following code to get the data from table Sales into the datagrid.
Dim rempRS As Recordset
strsql = "SELECT * from Sales"
Set tempRS = New Recordset
tempRS.Open strsql, goConn, adOpenKeyset, adLockPessimistic, adCmdText
DataGrid1.Visible = -1
Set DataGrid1.DataSource = tempRS
DataGrid1.Refresh
The property AllowUpdate for the datagrid is set to True.
Can anyone tell me what I need to do to allow changes to be made to table Sales directly via the DataGrid ?
Thanks,
Moben