FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour ADO - SQL-question
Posts: 1195
Joined: Mon Oct 17, 2005 05:41 AM
ADO - SQL-question
Posted: Mon Jul 09, 2012 07:59 AM

Hi,

Is is correct to say that if I download the connector

http://dev.mysql.com/downloads/connector/odbc/5.1.html

and use MariaDB, I can use MySQL with xHarbour without buying any other server licence? Or do I need someting else?

Thanks,
Marc

Regards,

Marc



FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Posts: 2706
Joined: Fri Oct 07, 2005 01:50 PM
Re: ADO - SQL-question
Posted: Mon Jul 09, 2012 02:28 PM

Marc

SQL Server Express is a free edition of SQL Server ideal for developing and powering desktop, web and small server applications.

http://www.microsoft.com/sqlserver/en/u ... press.aspx

The beauty of using Ms Sql server is that you can use ADO SqlOleDB which is loaded on every Microsoft computer .. you will not need to download any clients or worry about configuring ODBC.

Deploy your app and use it from any Windows computer nothing else is needed.

Rick Lipkin

Posts: 3358
Joined: Fri Oct 07, 2005 08:20 PM
Re: ADO - SQL-question
Posted: Mon Jul 09, 2012 04:13 PM

Marc:

If you use MariaDb then you don't need MySql and viceversa, and yes !, you need the
connector to use MariaDB or MySql with ADO.

I have a medium size app developed with ADO, xHarbour, FW and MySql, I made a test
with MariaDB and no change was necessary, all the code has been accepted.

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
Posts: 1195
Joined: Mon Oct 17, 2005 05:41 AM
Re: ADO - SQL-question
Posted: Tue Jul 10, 2012 06:33 PM
Rick Lipkin wrote:Marc

SQL Server Express is a free edition of SQL Server ideal for developing and powering desktop, web and small server applications.

http://www.microsoft.com/sqlserver/en/u ... press.aspx

The beauty of using Ms Sql server is that you can use ADO SqlOleDB which is loaded on every Microsoft computer .. you will not need to download any clients or worry about configuring ODBC.

Deploy your app and use it from any Windows computer nothing else is needed.

Rick Lipkin


Rick,

Thanks, for the very useful information. Do you have an example how to connect to this server?

Regards,
Marc
Regards,

Marc



FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Posts: 1195
Joined: Mon Oct 17, 2005 05:41 AM
Re: ADO - SQL-question
Posted: Tue Jul 10, 2012 06:36 PM
Armando wrote:Marc:

If you use MariaDb then you don't need MySql and viceversa, and yes !, you need the
connector to use MariaDB or MySql with ADO.

I have a medium size app developed with ADO, xHarbour, FW and MySql, I made a test
with MariaDB and no change was necessary, all the code has been accepted.

Regards


Armando,

Thank you for the information. Is the connector a free download, or is there a limitation? I thought once to have read on this forum that this was not free.

Regards,
Marc
Regards,

Marc



FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Posts: 3358
Joined: Fri Oct 07, 2005 08:20 PM
Re: ADO - SQL-question
Posted: Tue Jul 10, 2012 07:00 PM

Marc:

As I know, the connector is free but MySql is Freeware, here is the link for mariaDB, perhaps is your best option.

http://mariadb.org/en/

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
Posts: 2706
Joined: Fri Oct 07, 2005 01:50 PM
Re: ADO - SQL-question
Posted: Tue Jul 10, 2012 09:10 PM
Mark

Here is a very simple example how to set up the Sql Server Connection and how to open a recordset.

Rick

Code (fw): Select all Collapse
Local oRsRepair,cSql,oErr
Public xConnect

xPROVIDER   := "SQLOLEDB"
xSOURCE     := "YOURSQLSERVERNAME"   
xCATALOG    := "YOURDATABASENAME"
xUSERID      := "user"                       // this username has to have permission
xPASSWORD := "password"                // to login to the database

xCONNECT := 'Provider='+xPROVIDER+';Data Source='+xSOURCE+';Initial Catalog='+xCATALOG+';User Id='+xUSERID+';Password='+xPASSWORD

cSql := "Select * from YOURTABLE"

oRsRepair := TOleAuto():New( "ADODB.Recordset" )
oRsRepair:CursorType     := 1        // opendkeyset
oRsRepair:CursorLocation := 3        // local cache
oRsRepair:LockType       := 3        // lockoportunistic

TRY
   oRsRepair:Open( cSQL,xCONNECT )
CATCH oErr
   MsgInfo( "Error in Opening REPAIR table" )
   RETURN(.F.)
END TRY

xbrowse( oRsRepair )

oRsRepair:CLose()

Continue the discussion