Problems using OLADOCE in VB for Windows CE
Hi,
I m facing the following problems in OLADOCE
If anyone is facing similar problems kindly write back to me.
The device used is:
IPAQ 3760 (Pcoket PC 2002) with WinCE 3.0.
The S/W is as follows
Embedded Visual Basic 3.0
SDK for Pocket PC 2002
Oracle 9i Lite
1) The code below is from 9 lite documentation
Dim rs, i, L1
Set rs = CreateObject("oladoce.recordset")
rs.open "create table newtable (f1 varchar)"
rs.open "newtable", "", 1, 3
rs.addnew "f1", "a"
rs.addnew
rs.fields("f1") = "b"
rs.Update
rs.Close
rs.open "newtable"
Set rs = Nothing
The code highlighted in red gives an error that Object does not
support following method or property.
2) Because of the above error I used arrays to insert data into
tables and am facing the problem below.
I am unable to insert more than one record in any table using
OLADOCE.
The following code inserts record in test table for first time.
When I execute the same code second time it inserts the record
in the table and exits out of the application without any errors.
I have created a command button Insert and the code below gets
executed on click of the Insert button.
Also I have created a table test withe fields (empid number(4),
str_id number(4), acnt_id number(3), strt_dtm date,acnt_typ
varchar2(2), call_no number(2)) in the polite database.
Private Sub Insert_Click()
Dim rc
Set rc = CreateObject("oladoce.activeconnection")
rc.Connect ("polite")
'' creating and opening Recordset for test
Dim mrecfld As Variant
Dim mrecval As Variant
Dim mrecTmp
ReDim mrecfld(5)
ReDim mrecval(5)
Set mrecTmp = CreateObject("oladoce.recordset")
mrecTmp.Open "test", "", 1, 3
mrecfld(0) = "emp_id"
mrecfld(1) = "str_id"
mrecfld(2) = "acnt_id"
mrecfld(3) = "strt_dtm"
mrecfld(4) = "acnt_typ"
mrecfld(5) = "call_no"
mrecval(0) = 1
mrecval(1) = 1
mrecval(2) = 1
mrecval(3) = Now()
mrecval(4) = "NA"
mrecval(5) = 1
mrecTmp.addnew mrecfld, mrecval
mrecTmp.Update
mrecTmp.Close
Set mrecTmp = Nothing
End Sub
regards,
Sonal