Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Allow Update Not Working?

Status
Not open for further replies.

LiLgUrL

Technical User
Feb 9, 2003
59
0
0
CA
Function Connect_Dbase()
Set Conn = New ADODB.Connection
ConnStr = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & App.Path & "\dbSys.mdb;" & _
"Persist Security Info=False"
Conn.Open ConnStr
End Function


Dim rsX As ADODB.Recordset
Dim strRs As String
Call Connect_Dbase
strRs = "SELECT * from Temp_Info"
Set rsX = New ADODB.Recordset
rsX.CursorType = adOpenDynamic
rsX.CursorLocation = adUseClient
rsX.LockType = adLockPessimistic
rsX.Open "SELECT * from Temp_Info", Conn, adOpenForwardOnly, adLockPessimistic
Set dgrdMain.DataSource = rsX

I want to edit the values of my grid ... Allow Update is enabled but how come my table is not being updated.
Can anyone check my code and tell me if i'm missing something I can't figure it out. Please advice thanks!
 
You set the recordset properties individualy then again on the open line, which is uneccessary use one or the other. But on the Open you use adOpenForwardOnly - not an updatable type - try this.
Code:
    Set rsx = New ADODB.Recordset
    With rsx
        .Activconnection = Conn
        .CursorType = adOpenDynamic
        .CursorLocation = adUseClient
        .LockType = adLockPessimistic
        .Source = "SELECT * from Temp_Info"
        .Open
    End With
 
Thanks for the prompt reply SonOfEmidec1100 ... i tried your code but still my table is not being updated... if is impossible to update with the connections coded then perhapz i have no choice but to use the adodc (form style) i just dont want to use it as much as possible because it doesn't look good to me.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top