الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

Could not update

مغلق
بدأه Haym في 13 نوفمبر 2003 · 1 رد · 814 مشاهدة · في لغة Ms Visual Basic 6 وما قبلها من إصدارات
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

Hellow

please help me , infact i programmed aproject in Visula Basic with access , so whan i want insert or update any record in access database the follwong error occurs:

'Could not update; currently locked'

so pleas how i can solve this problem , please if there is any suggestion tell me

with best regards

#2

By using ADO ... do the following

1 - write this code in the Form_Load ()

Dim con As New ADODB.Connection

con.Provider = "Microsoft.Jet.OLEDB.4.0;Data Source=' here write the path of database ' with out comma ;Persist Security Info=False"

con.Open

The privous code for create Connection Object

2 - Now Write the SQL statment to insert or update ..

Dim sql As String

sal= "insert into Table_Name (field1,field2...) values (value1,value2) "

con.Execute sql

* notation , Don't forget the string value must be enclose by double qutes

like ,, "limo"

see this line ..

sql=" insert into Student_Table (S_Name,S_Age) values ('limo',21) "

but some time we need to use varaible insteade of the value ,,

sql ="insert into Student_Table (S_Name,S_Age) values ( ' " & name & ", ' " & age & ")"

where name and age are variable ...

finally don't forget make referance for Microsoft ActiveX Data Object Lib 2.0 ...

هذا الموضوع مغلق.

مواضيع مشابهة