Vilian,
See postings 4, and 5 on page 27 of this message thread on solving issues with Harbour.
James
Vilian,
See postings 4, and 5 on page 27 of this message thread on solving issues with Harbour.
James
James,
Thanks, but we decided make this migration using Tdolphin. It is more easy than I did think ![]()
Antonio F.,
There is a typo in this SET command from the ado.ch file:
"TEMPORAY" should be "TEMPORARY". I know this will break backward compatibility, but without it all new code will be causing errors because everyone will think they should be typing "temporary."
Strangely, I note that the spell checker for IE does not flag "TEMPORAY" as misspelled if it is in all caps--only if it is lower case.
Keep up the great work you are doing.
Regards,
James
/*
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 nilApplication
===========
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 nilI note that Antonio Ferreira seems to have disappeared. He hasn't posted anything on this forum since June 30.
Is the ADORDD project now dead?
Does anyone know what happened to him? I hope he has just been too busy.
I am very anxious to get some data into a SQL database, but so far have been unable to do so using the ADORDD. And I have had no response to any of my questions about this here.
Does anyone have sample (working) code to import a DBF? Preferably into an ACCESS database.
Regards,
James
#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 NILFWAdoCreateTable( "tableName", aFields, oCon, .T. )Pieter and Antonio,
I have already successfully created a table in the ACCESS database. Now I want to import data from a DBF to that table. The problem is that both APPEND BLANK and APPEND FROM error out. With a working RDD I should just be able to do:
use customer alias "cust"
append from SAMPLE.DBF via "DBFCDX"
But this isn't working. (See also my previous posts with the exact sample code I am trying to use.)
Regards,
James

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 nilPieter,
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
The file() function does not seem to be working.
In the tryadordd.prg this function is used like this:
if !FILE("table1;northwind.mdb")
It always returns .F. even when the table exists. I also tried it with the preceding \ syntax (that is used elsewhere in the example program):
if !FILE("table1";\northwind.mdb")
It always returns .F. also.
And I do wonder about having to include the database name. If we have to do this then it is not syntax compatible with existing FW code. We would have to change all calls to File() in our programs. Or, does it use an existing default database if no database is specified? I also tried that:
if !FILE("Table1")
Which also returns .F. even when the table exists.
Comments anyone?
Regards
James
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 bytesJames 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
Pieter,
Thanks for the response. In my case the table already has the HBRECNO field so that is not the issue. Today I will try a different database and try checking the integrity of the original one.
Perhaps you can post your error log when yours crashes.
James