/*
Purpose: Large file ADORDD test
Author : James Bott
Date : 7/9/2015 4:52:20 PM
*/
#include "fivewin.ch"
#include "adordd.ch"
REQUEST ADORDD, ADOVERSION
FUNCTION Main()
RddRegister("ADORDD",1)
RddSetDefault("ADORDD")
SET ADO FORCE LOCK OFF
SET ADO DEFAULT DATABASE TO "northwind.mdb" ;
SERVER TO "Microsoft.Jet.OLEDB.4.0" ;
ENGINE TO "ACCESS"
SELECT 0
USE PTIME alias "ptimeADO" via "ADORDD"
append from ptime via "DBFCDX"
BROWSE()
Return nil
Application
===========
Path and name: C:\Users\James\Documents\Projects\ADORDD\Test5.exe (32 bits)
Size: 3,003,904 bytes
Compiler version: xHarbour 1.2.3 Intl. (SimpLex) (Build 20130326)
FiveWin Version: FWHX 15.05
Windows version: 6.2, Build 9200
Time from start: 0 hours 0 mins 0 secs
Error occurred at: 07/09/15, 18:17:08
Error description: Error DBCMD/1005 Argument error: __DBAPP
Stack Calls
===========
Called from: => __DBAPP( 0 )
Called from: Test5.prg => MAIN( 27 )
/*
Purpose: File append test
Author : James Bott
Date : 7/9/2015 4:52:20 PM
*/
#include "fivewin.ch"
#include "adordd.ch"
REQUEST ADORDD, ADOVERSION
FUNCTION Main()
//createTemp()
RddRegister("ADORDD",1)
RddSetDefault("ADORDD")
SET ADO FORCE LOCK OFF
SET ADO DEFAULT DATABASE TO "northwind.mdb" ;
SERVER TO "Microsoft.Jet.OLEDB.4.0" ;
ENGINE TO "ACCESS"
// CONTROL LOCKING IN ADORDD FOR BOTH TABLE AND RECORD DONT PUT FINAL "\"
// Including the next line causes an error - JBott
// SET ADO LOCK CONTROL SHAREPATH TO "C:\users\james\documents\projects\adordd" RDD TO "DBFCDX"
// Note: File is empty
SELECT 0
USE PTIME alias "ptimeADO" //via "ADORDD"
msgInfo( used(),"File open" ) // returns .t.
msgInfo(tcharge2,"TCHARGE2") // returns 0.00
append blank // crashes
msginfo("Appended blank record")
tcharge2:=111.11
// append from temp via "DBFNTX" // crashes here
BROWSE()
Return nil
#include "FiveWin.ch"
#include "adodef.ch"
REQUEST DBFCDX
static oCn
//----------------------------------------------------------------------------//
function MyTest()
local oRs
CreateDatabaseIfNotYetExist()
ConnectWithDatabase()
FW_AdoImportFromDBF( oCn, "C:\Pieter\Dev\import\customer.dbf")
oRs = TRecSet():New():Open( "customer", oCn )
if oRs:IsOpen()
XBROWSER oRs // SETUP oBrw:lIncrFilter := .T.
// SETUP oBrw:bEdit := { | oRec | MyEdit( oRec ) }
// SETUP oBrw:lIncrSearch := .T.
// SETUP oBrw:lWildSeek := .T.
oRs:Close()
else
MsgAlert( "The recordset could not be opened" )
MsgInfo( "Check that you have REQUEST DBFCDX" )
endif
return nil
//----------------------------------------------------------------------------//
FUNCTION CloseDatabase()
oCn:Close()
RETURN NIL
FUNCTION ConnectWithDatabase()
ADOCONNECT oCn TO MYSQL SERVER localhost DATABASE <database> USER root PASSWORD <password> // PASSWORD ...
if oCn == nil .or. oCn:State < 1
MsgInfo( "Connect failed" )
return nil
endif
MsgInfo( "Connection Open" )
RETURN NIL
FWAdoCreateTable( "tableName", aFields, oCon, .T. )
Application
===========
Path and name: C:\Pieter\adorddtest\adorddtest.exe (32 bits)
Size: 2,769,408 bytes
Compiler version: xHarbour 1.2.3 Intl. (SimpLex) (Build 20150213)
FiveWin Version: FWHX 15.01
Windows version: 6.2, Build 9200
Time from start: 0 hours 0 mins 1 secs
Error occurred at: 07/20/15, 14:46:29
Error description: Error DBCMD/1005 Argument error: __DBAPP
Stack Calls
===========
Called from: => __DBAPP( 0 )
Called from: adorddtest.prg => MAIN( 18 )
System
======
CPU type: Intel(R) Pentium(R) CPU N3540 @ 2.16GHz 2166 Mhz
Hardware memory: 3500 megs
Free System resources: 90 %
GDI resources: 90 %
User resources: 90 %
Windows total applications running: 5
1 ,
2 , C:\Windows\SYSTEM32\SHLWAPI.dll
3 , C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df_5.82.9600.17810_none_7c5b6
4 DDE Server Window, C:\Windows\SYSTEM32\OLE32.DLL
5 Tussen taken schakelen, C:\Pieter\adorddtest\adorddtest.exe
Variables in use
================
Procedure Type Value
==========================
__DBAPP
Param 1: C "customer2.dbf"
Param 2: A Len: 0
Param 3: U
Param 4: U
Param 5: U
Param 6: U
Param 7: L .F.
Param 8: C "DBFCDX"
Param 9: U
Param 10: U
Local 1: U
Local 2: L .T.
MAIN
Linked RDDs
===========
DBF
DBFFPT
DBFBLOB
DBFNTX
ADORDD
DataBases in use
================
1: => CUSTOMER RddName: ADORDD
==============================
RecNo RecCount BOF EOF
1 500 .F. .F.
Indexes in use TagName
Relations in use
Classes in use:
===============
1 ERROR
2 HASHENTRY
3 HBCLASS
4 TOLEAUTO
5 HBOBJECT
6 TREG32
Memory Analysis
===============
261 Static variables
Dynamic memory consume:
Actual Value: 0 bytes
Highest Value: 0 bytes
#include "fivewin.ch"
#include "adordd.ch"
REQUEST ADORDD, ADOVERSION
FUNCTION Main()
RddRegister("ADORDD",1)
RddSetDefault("ADORDD")
SET ADO FORCE LOCK OFF // Required!
SET ADO DEFAULT DATABASE TO <database> SERVER TO "localhost" ENGINE TO "MYSQL" USER TO "root" PASSWORD TO <password>
USE CUSTOMER
//APPEND BLANK
//REPLACE FIELD->FIRST WITH "Pieter"
//APPEND FROM customer2.dbf via "DBFCDX"
BROWSE()
Return nil
Application
===========
Path and name: C:\Users\James\Documents\Projects\ADORDD\Test8.exe (32 bits)
Size: 2,985,984 bytes
Compiler version: xHarbour 1.2.3 Intl. (SimpLex) (Build 20141106)
FiveWin Version: FWHX 15.05
Windows version: 6.2, Build 9200
Time from start: 0 hours 0 mins 48 secs
Error occurred at: 07/27/15, 22:43:27
Error description: Error ADODB.Connection/0 S_OK: EXECUTE
Args:
[ 1] = C UPDATE PTIME SET [REF] = '38739#'C' WHERE [HBRECNO] = 548
Stack Calls
===========
Called from: => TOLEAUTO:EXECUTE( 0 )
Called from: adordd.prg => ADO_PUTVALUE( 1513 )
Called from: => __DBAPP( 0 )
Called from: Test8.prg => MAIN( 52 )
System
======
CPU type: AMD A8-4555M APU with Radeon(tm) HD Graphics 1600 Mhz
Hardware memory: 3271 megs
Free System resources: 90 %
GDI resources: 90 %
User resources: 90 %
Windows total applications running: 3
1 GDI+ Window,
2 GDI+ Window, C:\Windows\WinSxS\x86_microsoft.windows.gdiplus_6595b64144ccf1df_1.1.9600.17415_none_dad8722c5bcc2d
3 Task Switching, C:\Users\James\Documents\Projects\ADORDD\Test8.exe
Variables in use
================
Procedure Type Value
==========================
TOLEAUTO:EXECUTE
Param 1: C "UPDATE PTIME SET [REF] = '38739#'C' WHERE [HBRECNO] = 548"
Local 1: U
Local 2: C "ADODB.Connection"
ADO_PUTVALUE
Param 1: N 1
Param 2: N 9
Param 3: C "'38739#'C'"
Local 1: A Len: 37
Local 2: O Class: TOLEAUTO
Local 3: N 548
Local 4: A Len: 6
Local 5: U
Local 6: U
__DBAPP
Param 1: C "ptime"
Param 2: A Len: 0
Param 3: U
Param 4: U
Param 5: U
Param 6: U
Param 7: L .F.
Param 8: C "DBFNTX"
Param 9: U
Param 10: U
MAIN
Linked RDDs
===========
DBF
DBFFPT
DBFBLOB
DBFNTX
ADORDD
DataBases in use
================
1: PTIME1 RddName: ADORDD
==============================
RecNo RecCount BOF EOF
548 548 .F. .F.
Indexes in use TagName
Relations in use
Classes in use:
===============
1 ERROR
2 HASHENTRY
3 HBCLASS
4 TOLEAUTO
5 VTWRAPPER
6 HBOBJECT
7 TREG32
Memory Analysis
===============
368 Static variables
Dynamic memory consume:
Actual Value: 0 bytes
Highest Value: 0 bytes
James Bott wrote:Pieter,
The field HBRECNO has to be added to every table. It is an auto-increment field.
Search this forum topic for HBRECNO for more information. I still do not really understand its purpose, but it is needed, nor do I have the exact syntax for adding it to existing SQL databases. Maybe someone else can show us how.
James
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: Antonio Linares, Google [Bot] and 62 guests