Ado Sample / ejemplo Ado

HMG Samples and Enhancements

Moderator: Rathinagiri

User avatar
mol
Posts: 3718
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: Ado Sample / ejemplo Ado

Post by mol »

:cry: It doesn't work:

Code: Select all

	oConexion = TOleauto():New('ADODB.Connection')                    	
	oConexion:ConnectionString ="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Plu.DB;Extended Properties=Paradox 5.x;"
	oConexion:Open()

and I have no idea why....

I've changed:

Code: Select all

	oConexion:ConnectionString ="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\projekty\paradox;Extended Properties=Paradox 5.x;"
I found, that Data Source in connection string must be only path to files!
Changed, and it works!!!!

Many thanks!


PS. I've got problem with polish native characters - how to resolve it?
User avatar
luisvasquezcl
Posts: 1258
Joined: Thu Jul 31, 2008 3:23 am
Location: Chile
Contact:

Re: Ado Sample / ejemplo Ado

Post by luisvasquezcl »

is correct
you must change the data source for your path.
About the polish language, i dont know how gived solution...
May be Roberto can you help.
Regards,
Luis Vásquez.
User avatar
esgici
Posts: 4543
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Contact:

Re: Ado Sample / ejemplo Ado

Post by esgici »

Hi Marek
mol wrote: PS. I've got problem with polish native characters - how to resolve it?
Did you tried HB_OEMTOANSI() ?

( If your PDX file came from DOS )

Regards

--

Esgici
Viva INTERNATIONAL HMG :D
User avatar
mol
Posts: 3718
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: Ado Sample / ejemplo Ado

Post by mol »

My pdx file came from windows application.
I've tried HB_OEMToANSI(), but it doesn't look good.

I was watching .db file using simple hex viewer and I wrote conversion procedure, but I think, paradox driver for windows converts character - but wrong...
I will write tomorrow working converter...
User avatar
Vanguarda
Posts: 543
Joined: Wed Feb 11, 2009 10:56 am
Location: Americana - SP
Contact:

Re: Ado Sample / ejemplo Ado

Post by Vanguarda »

Thanks luisvasquezcl for sharing with us.



with best regards,
--
Paulo Sérgio Durço (Vanguarda)


http://hmglights.wordpress.com/
User avatar
mol
Posts: 3718
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: Ado Sample / ejemplo Ado

Post by mol »

I've prepared simple database containing 18 records - for 18 native polish characters.
I've got very stupid results opening this database with my program.
Opening the same database with MS Excel gives also strange results.

I think, it's caused by OLE driver...
User avatar
luisvasquezcl
Posts: 1258
Joined: Thu Jul 31, 2008 3:23 am
Location: Chile
Contact:

Re: Ado Sample / ejemplo Ado

Post by luisvasquezcl »

Vanguarda Thanks for your words.
Mol, I think it is the driver that is causing problems,
Roberto said that the matter?
User avatar
mol
Posts: 3718
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: Ado Sample / ejemplo Ado

Post by mol »

I've tried to connect via ODBC drivers. It causes the same problems with version for Parado 5.x and 7.x.
I must hang this theme...
User avatar
Vanguarda
Posts: 543
Joined: Wed Feb 11, 2009 10:56 am
Location: Americana - SP
Contact:

Re: Ado Sample / ejemplo Ado

Post by Vanguarda »

Hi luisvasquezcl,

Thank for this nice example. It will be very useful for me.


with best regards,
--
Paulo Sérgio Durço (Vanguarda)


http://hmglights.wordpress.com/
User avatar
Ismach
Posts: 161
Joined: Wed Nov 28, 2012 5:55 pm
DBs Used: DBF, mySQL, Mariadb, postgreSQL, Oracle, Db2, Interbase, Firebird, and SQLite
Location: Buenos Aires - Argentina

Re: Ado Sample / ejemplo Ado

Post by Ismach »

someone could connect to database paradox? My code is this but it shows me an error

Code: Select all

     oPConn:= TOleauto():New('Adodb.Connection')
     oPConn:ConnectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=F:\Gamdesa\GamTest;Extended Properties=Paradox 5.x;"
     oPConn:Open()
     
     ccSQL  := "Select Nutab, Posi, Norubr, Cle, Occurs, Type, Long, Dec, Signe From Structdata.db order by Nutab, Posi;"

     Rs := TOleauto():New('Adodb.recordset')
     Rs:CursorLocation = adUseClient
     Rs:Open( ccSQL , oPConn, adOpenDynamic, adLockReadOnly )
Post Reply