Help :-( (Firebird / AdoRdd)

Help :-( (Firebird / AdoRdd)

Postby Jeff Barnes » Tue May 05, 2009 11:50 pm

Hi,

I think I have become my own worst enemy :oops:

I have been looking at sqlwin, sqlrdd and adordd and now I am lost ... everything is starting to mix together :(

I have created a file called Fusion.gdb (firebird)
In Fusion.gdb I have a table called "Patients"

Can someone please help me connect to the database using adordd ? or SqlWin ?

I was able to connect to fusion.gbd with SQLRDD demo but I was never able to open "patients" and the cost is quite high.

I can open and view the "patients" table using IBEasy+ so I know the database is good.
Last edited by Jeff Barnes on Thu May 07, 2009 12:31 pm, edited 1 time in total.
Thanks,
Jeff Barnes

(FWH 16.11, xHarbour 1.2.3, Bcc730)
User avatar
Jeff Barnes
 
Posts: 929
Joined: Sun Oct 09, 2005 1:05 pm
Location: Ontario, Canada

Re: Help :-(

Postby Armando » Wed May 06, 2009 12:01 am

Jeff:

If the Spanish language it doesn't matter for you, Have a look to my blog

http://sqlcmd.blogspot.com/

You'll find the basic steps to start with MySql & ADO. Btw ADO it's free, you have it in xHarbour.

And have a look the next link too.

http://connectionstrings.com/sql-server-2005

Best regards
SOI, s.a. de c.v.
estbucarm@gmail.com
http://www.soisa.mex.tl/
http://sqlcmd.blogspot.com/
Tel. (722) 174 44 45
Carpe diem quam minimum credula postero
User avatar
Armando
 
Posts: 3211
Joined: Fri Oct 07, 2005 8:20 pm
Location: Toluca, México

Re: Help :-(

Postby Jeff Barnes » Wed May 06, 2009 1:15 am

Thanks for the links Armando, however, I need to connect to Firebird not MySql.
(also I do not speak Spanish :wink: )
Thanks,
Jeff Barnes

(FWH 16.11, xHarbour 1.2.3, Bcc730)
User avatar
Jeff Barnes
 
Posts: 929
Joined: Sun Oct 09, 2005 1:05 pm
Location: Ontario, Canada

Re: Help :-(

Postby Armando » Wed May 06, 2009 1:33 am

Jeff:

Have a look to this link

http://connectionstrings.com/firebird

Regards
SOI, s.a. de c.v.
estbucarm@gmail.com
http://www.soisa.mex.tl/
http://sqlcmd.blogspot.com/
Tel. (722) 174 44 45
Carpe diem quam minimum credula postero
User avatar
Armando
 
Posts: 3211
Joined: Fri Oct 07, 2005 8:20 pm
Location: Toluca, México

Re: Help :-(

Postby Jeff Barnes » Wed May 06, 2009 3:37 am

I have installed MySql and have tried the following:

Code: Select all  Expand view
USE \FusionEMR\Data\Fusion.gdb VIA "ADORDD" TABLE "PATIENTS" MYSQL FROM "127.0.0.1" USER "fusion" PASSWORD "fusion"


When I launch my app I get this Error on the above line:

Error description: Error BASE/1003 Variable does not exist: S_CTABLENAME
Called From: adordd.prg=> ADO_OPEN(212)
Called From: => DBUSEAREA(0)
Called From: fusion.prg => OPENFILES(254)


At the top of my app I have:
#include "adordd.ch"
REQUEST ADORDD

NOTE:
I had to rebuild adordd.prg to match my version of xharbour ... I found some old instructions to create an OBJ from the prg so I have adordd.obj linked in instead of a LIB file. I don't know if it make any difference.
Thanks,
Jeff Barnes

(FWH 16.11, xHarbour 1.2.3, Bcc730)
User avatar
Jeff Barnes
 
Posts: 929
Joined: Sun Oct 09, 2005 1:05 pm
Location: Ontario, Canada

Re: Help :-(

Postby dutch » Wed May 06, 2009 4:33 am

Dear Jeff,

This sample works fine.
Code: Select all  Expand view
// Testing LOCATE and CONTINUE
#include "FiveWin.ch"
#include "adordd.ch"

REQUEST ADORDD

function Main()
// databae on web
   USE support VIA "ADORDD" TABLE "hotel" MYSQL ;
      FROM "www.easyfo.com" USER "user" PASSWORD "password"
/*
  // database on local disk
   USE php362 VIA "ADORDD" TABLE "SUPPORT_TOPIC" MYSQL ;
      FROM "localhost" USER "root" PASSWORD "password"
*/


   browse()

   USE

return nil


Regards,
Dutch
Regards,
Dutch

FWH 19.01 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio
FWPPC 10.02 / Harbour for PPC (FTDN)
ADS V.9 / MySql / MariaDB
R&R 12 Infinity / Crystal Report XI R2
(Thailand)
User avatar
dutch
 
Posts: 1542
Joined: Fri Oct 07, 2005 5:56 pm
Location: Thailand

Re: Help :-(

Postby Jeff Barnes » Wed May 06, 2009 2:18 pm

I give up.

It looks like I need to stick with FireBird and I just can not get a connection. :?
Thanks,
Jeff Barnes

(FWH 16.11, xHarbour 1.2.3, Bcc730)
User avatar
Jeff Barnes
 
Posts: 929
Joined: Sun Oct 09, 2005 1:05 pm
Location: Ontario, Canada

Re: Help :-( (Firebird / AdoRdd)

Postby Jeff Barnes » Thu May 07, 2009 12:34 pm

Can anyone tell me if you can access a Firebird database via Adordd and use the standard xbase commands or am I going in the wrong direction?

I have tried a number of things and still have no luck.

Please, could someone please provide some sample code showing how to connect and "USE" a firebird database.
Thanks,
Jeff Barnes

(FWH 16.11, xHarbour 1.2.3, Bcc730)
User avatar
Jeff Barnes
 
Posts: 929
Joined: Sun Oct 09, 2005 1:05 pm
Location: Ontario, Canada

Re: Help :-( (Firebird / AdoRdd)

Postby Rimantas » Thu May 07, 2009 7:44 pm

Jeff Barnes wrote:Can anyone tell me if you can access a Firebird database via Adordd and use the standard xbase commands or am I going in the wrong direction?

I have tried a number of things and still have no luck.

Please, could someone please provide some sample code showing how to connect and "USE" a firebird database.


Jeff ,

Do you have an "data provider" to FireBird database ? Did you installed such things ? Like this - http://www.ibobjects.com/Ole_db.html ? You can't to connect to FireBird db through Ado if in yours computers doesn't exist OleDb drivers ...
Rimantas U.
User avatar
Rimantas
 
Posts: 437
Joined: Fri Oct 07, 2005 12:56 pm
Location: Utena , Lithuania

Re: Help :-( (Firebird / AdoRdd)

Postby Jeff Barnes » Thu May 07, 2009 8:43 pm

Hi Rimantas,

I have installed this:
http://www.ibphoenix.com/main.nfs?a=ibp%20...%20bp_60_odbc

It is an ODBC driver (I have also created an entry in my data sources in the windows control panel)

Do I also need to install the driver from your link?

Also, can you provide a code sample so I can see how to connect?


I really appreciate everyone's help on this ... this is my first shot at SQL and sadly it is not going so well right now :cry:
Thanks,
Jeff Barnes

(FWH 16.11, xHarbour 1.2.3, Bcc730)
User avatar
Jeff Barnes
 
Posts: 929
Joined: Sun Oct 09, 2005 1:05 pm
Location: Ontario, Canada

Re: Help :-( (Firebird / AdoRdd)

Postby Rick Lipkin » Thu May 07, 2009 9:02 pm

Jeff

ODBC is not the way to go .. you do need the Firebird ole provider to connect via ADO.. Lots of reference and examples here .. search the forum for ADO .. also http://connectionstrings.com is a great resoruce for connecting to various datanases and their syntax.

Rick Lipkin
User avatar
Rick Lipkin
 
Posts: 2665
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: Help :-( (Firebird / AdoRdd)

Postby hua » Fri May 08, 2009 2:03 am

Hi Jeff,
So far this is what I've managed to cook up and some steps that I took in getting there.

1. Download and install Firebird server 2.0 series.

2. Download the free version of ADO driver from IBProvider
(NOTE: The free version supports up to Firebird 2.0 series only. Later versions require the commercial driver. See the list of differences here).

3. Finally FWH code that I use to do minor test.

Code: Select all  Expand view

#include "Fivewin.ch"
#include "Tcbrowse.ch"

//-------------
FUNCTION MAIN()

    LOCAL oRs, oErr
    local cConnStr := 'Provider=LCPI.IBProvider.3.Free;'+;
                  'Password=masterkey;User ID=sysdba;auto_commit=true;'+;
                  'Data Source=localhost:c:\employee.fdb;ctype="";dbclient_library=""'
    local oCon := CreateObject("ADODB.Connection")
    oCon:ConnectionString := cConnStr

    TRY
        oCon:Open()
    CATCH
        ShowAdoError(oCon)
        RETURN NIL
    END TRY

    oRs := CreateObject('ADODB.RecordSet')
    oRs:CursorLocation := 3
    TRY
      *oCon:BeginTrans()
      oRs:Open("SELECT CUSTOMER FROM CUSTOMER", oCon, 1, 3)
      *oCon:CommitTrans()
    CATCH
      ShowADOError(oCon)
    END

    msginfo("about to view")
    ? ors:fields("CUSTOMER"):value

    WBROWSERECORDSET( oRs )
    TCBROWSERECORDSET( oRs )

    oRs:Close()
    oCon:close()
    RETURN NIL


STATIC FUNCTION WBROWSERECORDSET( oRs )

    LOCAL oDlg, oBrw, nRec

    DEFINE DIALOG oDlg SIZE 300, 300

    @ 0, 0 LISTBOX oBrw FIELDS oRs:Fields( "CUSTOMER" ):Value;
           HEADERS "CLIENTI";
           ON RIGHT CLICK ( nRec := oRs:AbsolutePosition,;
                            oBrw:Report( "TWBrowse report", .T. ),;
                            oRs:MoveFirst(),;
                            oRs:Move( nRec - 1 ) )

    oBrw:bLogicLen = { || oRs:RecordCount }
    oBrw:bGoTop    = { || oRs:MoveFirst() }
    oBrw:bGoBottom = { || oRs:MoveLast() }
    oBrw:bSkip     = { | nSkip | Skipper( oRs, nSkip ) }
    oBrw:cAlias    = "ARRAY"

    ACTIVATE DIALOG oDlg;
             ON INIT oDlg:SetControl( oBrw );
             CENTER

    RETURN NIL


STATIC FUNCTION TCBROWSERECORDSET( oRs )

    LOCAL oDlg, oBrw, oCol, nRec

    DEFINE DIALOG oDlg SIZE 300, 300

    @ 0, 0 BROWSE oBrw;
           ON RIGHT CLICK ( nRec := oRs:AbsolutePosition,;
                            oBrw:Report( "TWBrowse report", .T. ),;
                            oRs:MoveFirst(),;
                            oRs:Move( nRec - 1 ) )

    ADD COLUMN TO oBrw;
               DATA oRs:Fields( "customer" ):Value;
               HEADER "CLIENTI"

    oBrw:lCellStyle = .T.

    oBrw:bLogicLen = { || oRs:RecordCount }
    oBrw:bGoTop    = { || oRs:MoveFirst() }
    oBrw:bGoBottom = { || oRs:MoveLast() }
    oBrw:bSkip     = { | nSkip | Skipper( oRs, nSkip ) }
    oBrw:cAlias    = "ARRAY"

    ACTIVATE DIALOG oDlg;
             ON INIT oDlg:SetControl( oBrw );
             CENTER

    RETURN NIL


STATIC FUNCTION SKIPPER( oRs, nSkip )

    LOCAL nRec := oRs:AbsolutePosition

    oRs:Move( nSkip )

    IF oRs:EOF; oRs:MoveLast(); ENDIF
    IF oRs:BOF; oRs:MoveFirst(); ENDIF

    RETURN oRs:AbsolutePosition - nRec

STATIC FUNCTION ShowAdoError(oCon)

LOCAL   nAdoErrors   := 0
LOCAL   oAdoErr

      nAdoErrors   :=  oCon:Errors:Count()
      IF nAdoErrors > 0
         oAdoErr      := oCon:Errors(nAdoErrors-1)
         msginfo( oAdoErr:Description + CRLF + oAdoErr:Source )
      ELSE
         msginfo( 'Not Oracle Error' )
      ENDIF

RETURN nil
 


There are a few ADO stuffs that I collected from the forum and posted it in one place here (http://wiki.fivetechsoft.com/doku.php?i ... ted_stuffs)
FWH 11.08/FWH 19.12
BCC5.82/BCC7.3
xHarbour/Harbour
hua
 
Posts: 1072
Joined: Fri Oct 28, 2005 2:27 am


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 92 guests