|
-
Aug 23rd, 2000, 10:33 AM
#1
Thread Starter
Frenzied Member
Code:
Private Sub LogUser(UsrName As String)
SQL = "SELECT UserName FROM LoggedUsers WHERE UserName = " & "'" & UsrName & "'"
CheckUserRecord.Close
CheckUserRecord.Open SQL, MeterInfo
With CheckUserRecord
If .EOF Then
.AddNew
!UserName = UsrName
.Update
End If
.Close
End With
End Sub
gives me error
"object or provider is not capable of performing the operation"
damn ADO... dao was easier
-
Aug 23rd, 2000, 10:43 AM
#2
Fanatic Member
Try this ...
Code:
Private Sub LogUser(UsrName As String)
SQL = "SELECT UserName FROM LoggedUsers WHERE UserName = '" & UsrName & "'"
CheckUserRecord.Open SQL, MeterInfo
If CheckUserRecord.EOF Then
CheckUserRecord.Close
CheckUserRecord.CursorType = adOpenKeyset
CheckUserRecord.Open "LoggedUsers", MeterInfo, , , adCmdTable
CheckUserRecord.AddNew
CheckUserRecord!UserName = UsrName
CheckUserRecord.Update
End If
CheckUserRecord.Close
End Sub
VB6 sp5, SQL Server 2000, C#
There are no stupid questions. Only stupid people. 
-
Aug 23rd, 2000, 10:50 AM
#3
Fanatic Member
Ado Methods for Changing records
Hi there,
Before opening the connection ensure you have set the ado locktype and cursortype properties, since by default the go to read only. You can also test using the 'supports' property to check if updating is allowed.
-
Aug 23rd, 2000, 11:20 AM
#4
Thread Starter
Frenzied Member
still get the error
Code:
Private Sub LogUser(UsrName As String)
SQL = "SELECT UserName FROM LoggedUsers WHERE UserName = " & "'" & UsrName & "'"
CheckUserRecord.Close
CheckUserRecord.Open SQL, MeterInfo
With CheckUserRecord
If .EOF Then
.Close
.CursorType = adOpenKeyset
.Open "LoggedUsers", MeterInfo, , , adCmdTable
.AddNew
!UserName = UsrName
.Update
End If
.Close
End With
End Sub
-
Aug 23rd, 2000, 11:37 AM
#5
Fanatic Member
That works for me except I also have the line
Code:
CheckUserRecord.LockType = adLockOptimistic
just after
Code:
CheckUserRecord.CursorType = adOpenKeyset
VB6 sp5, SQL Server 2000, C#
There are no stupid questions. Only stupid people. 
-
Aug 23rd, 2000, 11:40 AM
#6
Thread Starter
Frenzied Member
hehe dats funny...
i been waiting for a reply.. maybe 25 min
then am like "grr got to figure this out on my own"
i did
came back
and boom stevie said same thing as i did
thanks for all the help guyz
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
|
Click Here to Expand Forum to Full Width
|