 |
LEKO Level: Trainee
 Registered: 22-02-2010 Posts: 2
|
Execute dont work with vb6 and access 2000, why?
Hi all, im accessing access 2000 with dao 3.6 and vb 6.0 sp4, im not using data control, and i dont want to use it.
I open the database with...
Set ws_PDF = DBEngine.Workspaces(0)
Set BASE_PDF = ws_PDF.OpenDatabase(RUTA_PDF)
Base open perfectly and can use select sql to read without problems, the problems are when i use insert, delete or update, the execute command do nothing.
Something like...
sql = "DELETE FROM PERSONAS WHERE codigopersona=" & codigoRP & " and CodigoC=1 and NumeroC=1 and CodigoD=1"
BASE_PDF.Execute sql
Execute, no error, but nothing happens, if i open the database in access, open the table, and access to the table, vb6 report the problem is locked (with select), when use execute (insert, delete etc), nothing happens.
I really need help with that, i cant find a solution.
Help me please.
|
|
22-02-2010 at 07:08 AM |
|
|
Anaru Level: Trainee
 Registered: 22-02-2010 Posts: 1
|
Re: Execute dont work with vb6 and access 2000, why?
Hello LEKO,
My knowledge of Visual Basic 6.0 may be somewhat limited where the usage of DAO and MS Access is conerned, however I will offer my approach to acheiving the same thing you are trying to do using the DAO 3.5 Reference (it works with 3.6 too).
Sub DeleteRecord(plonRecordID As Long)
Dim dbExample As Database
Dim rsExample As Recordset
Dim strQuery As String
strQuery = "DELETE FROM Records WHERE RecordID=" & plonRecordID
Set dbExample = OpenDatabase("C:\Example Project\Example.mdb")
Set rsExample = dbExample.OpenRecordset(strQuery, dbOpenDynaset)
End Sub |
Regards,
Anaru
|
|
22-02-2010 at 10:43 AM |
|
|
LEKO Level: Trainee
 Registered: 22-02-2010 Posts: 2
|
Re: Execute dont work with vb6 and access 2000, why?
Im getting no valid operation error with that.
|
|
|
22-02-2010 at 06:51 PM |
|
|
|
|
 |
 |