|
-
Nov 28th, 1999, 04:17 AM
#1
Thread Starter
Junior Member
Can someone tell me what's wrong with this code and why it doesn't update the database?
Private Sub cmdPicture_Click()
Dim sFile As String
Dim db As Database
Dim rs As Recordset
With dlgCommonDialog
.DialogTitle = "Open"
.CancelError = False
.Filter = "BMP Files (*.BMP)|*.BMP"
.ShowOpen
sFile = .FileName
End With
frmMembers.Image1.Picture = LoadPicture(sFile)
frmMembers.lblPicturePath.Caption = sFile
Set db = OpenDatabase(App.Path & "\Members.mdb")
Set rs = db.OpenRecordset("MemberInfo", dbOpenDynaset)
rs.Edit
rs!PicturePath = sFile
Recordset("PicturePath") = Text1.Text
rs.Update
End Sub
GiD
-
Nov 28th, 1999, 05:10 AM
#2
Junior Member
-
Nov 28th, 1999, 05:24 AM
#3
Thread Starter
Junior Member
Nope that didn't do it....can anyone out there help out? I just can't seem to get the database to update? I keep getting an error that says the database is readonly but its not. I've checked!
GiD
-
Nov 28th, 1999, 08:15 AM
#4
Check the actual Read Attribute in the MDBs File Properties, could be it was left checked after a previous program crash?
Another possibility is that you have the DB open in something else and it's opened Exclusively.
------------------
Aaron Young
Analyst Programmer
[email protected]
[email protected]
-
Nov 28th, 1999, 09:33 AM
#5
Hyperactive Member
Hi,GiD.
Do you use ODBC? I had the same problem and I found on microsoft support page solution, you have to provide all 4 parameters in OpenRecordset.
Set rst=db.OpenRecordset _("TableName",dbOpenDynamic,0,dbOptimistic)
NOTE: You must supply a zero (0) for the Option argument.
Hope it help.
Larisa
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
|