Hi All...
can someone help me....?
I try to migration database file from a DBF to Oracle database file.
but i cannot execute query : Insert and Update.
my code like this:
#include "fivewin.ch"
static oRs, oErr
func main
local cSQL, cConnStr
local i, txtKode := "01x", txtKet := "test it"
cSQL := "SELECT * FROM MyTable"
cConnStr := 'Provider=MSDAORA.1;Data Source=dblocal;User ID=mulyadi;Password=1234'
oRs := TOleAuto():New( "ADODB.Recordset" )
oRs:CursorType := 1 // opendkeyset
oRs:CursorLocation := 3 // local cache
oRs:LockType := 3 // lockoportunistic
TRY
oRs:Open( cSQL, cConnStr )
CATCH oErr
MsgInfo( "Error in Opening Oracle table" )
RETURN(.F.)
END TRY
oRs:MoveFirst()
// add record --> is Oke
for i := 1 to 5
oRs:AddNew()
oRs:Fields(0):Value := "01" + alltrim(str(10 + i))
oRs:Fields(1):Value := "test " + oRs:Fields(0):Value
oRs:Update()
next i
// now i try to use a Query
cSQL = "INSERT INTO MyTable (KODE,KET) VALUE( '" + txtKode + "','" + txtKet + "')"
//
FW_OpenRecordSet( cConnStr, cSQL ) /* result ---> no action */
// or
HB_AdoSetQuery( cSQL ) /* result ---> no action */
oRs:Close()
return nil
Hi friend... what wrong with my Code....?