ADO - SQL-question

ADO - SQL-question

Postby Marc Vanzegbroeck » Mon Jul 09, 2012 7: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
Marc Vanzegbroeck
 
Posts: 1159
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium

Re: ADO - SQL-question

Postby Rick Lipkin » Mon Jul 09, 2012 2: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
User avatar
Rick Lipkin
 
Posts: 2665
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: ADO - SQL-question

Postby Armando » Mon Jul 09, 2012 4: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
User avatar
Armando
 
Posts: 3222
Joined: Fri Oct 07, 2005 8:20 pm
Location: Toluca, México

Re: ADO - SQL-question

Postby Marc Vanzegbroeck » Tue Jul 10, 2012 6: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
Marc Vanzegbroeck
 
Posts: 1159
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium

Re: ADO - SQL-question

Postby Marc Vanzegbroeck » Tue Jul 10, 2012 6: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
Marc Vanzegbroeck
 
Posts: 1159
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium

Re: ADO - SQL-question

Postby Armando » Tue Jul 10, 2012 7: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
User avatar
Armando
 
Posts: 3222
Joined: Fri Oct 07, 2005 8:20 pm
Location: Toluca, México

Re: ADO - SQL-question

Postby Rick Lipkin » Tue Jul 10, 2012 9: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: Select all  Expand view


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()

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


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 52 guests