Re: Visual Foxpro

2003-06-17 Thread José Angel Blanco Linares
Sorry, but what did dou mean with 'Are you still using VisualFoxPro...'?
:)

Mensaje citado por: "Ruiz González, Jose de Jesus" <[EMAIL PROTECTED]>:

> Are you still using VisualFoxPro as the programmig language in your
> project?
> If so, you can use SQL functions from VisualFoxPro to connect to mySQL
> using
> ODBC
> 
> Install mySQL (if you have not allready do it )
> Then install MyODBC-3.51.06.exe (downloadable from mySQL page)
> Create the ODBC bridge to mySQL with the ODBC Administrator
> 
> If your project is OO then you can understand the next code I wrote
> (Whith
> this classes I connecto to Oracle, SQL Server
> and, of course mySQL )
> 
>   COdbc
>^   ^
>|   |
> COdbcSynchBatchMan COdbcSynchBatchNotrans
>   ^ ^ ^
>   | |  |
> CORACLECSQLSERVER CMYSQL
> 
> Instantiate a CMYSQL object and you are ready
> 
> * //
> define class COdbc as custom
>   protected m_sClsNam
>   protected m_sSourceName && CO
>   protected m_sUserID && ops$jjr
>   protected m_sPassword   && jjr
>   protected m_iConnectionID   && numero devuelto por
> sqlconnect
>   protected m_sCursorResults  && cursor en que se
> devuelven los datos
>   protected m_sCursorColumns  && cursor en que estan los nombres
> de las columnas SQLCOLUMNS
>   protected m_sCursorTables   && cursor en que estan los
> nombres de la tablas SQLTABLES
>   protected m_bInTransaction  && bandera para indicar si
> se esta en transaccion o no
>   protected m_sErrorString&& cadena con mensaje de
> error
>   protected m_sLogFile&& ruta y nombre de archivo
> log
>   protected m_bLoggingOut && ¿Logging?
>   protected m_oLogFile&& CTextFile
>   protected m_sSqlCmd
>   protected m_sScriptsPath
>   protected m_iIdiom  && idioma a usar
> para los nombres de meses
>   
>   **
>   * ts1: SourceName
>   * ts2: UserId
>   * ts3: Password
>   procedure Init
>   parameter ts1, ts2, ts3
>   this.m_sClsNam = 'Codbc'
>   this.m_sSourceName = ts1
>   this.m_sUserID = ts2
>   this.m_sPassword = ts3
>   this.m_iConnectionID = -1
>   this.m_sCursorResults = ''
>   this.m_sCursorColumns = ''
>   this.m_sCursorTables = ''
>   this.m_sErrorString = ''
>   this.m_sLogFile = TEMPDIR + 'codbc.log'
>   this.m_bLoggingOut = .F.
>   this.m_sSqlCmd = ''
>   this.m_sScriptsPath = 'd:\fpw25\importa\oracle\scripts\'
>   this.m_iIdiom = THIs.GENGLISH()
>   endproc
>   
>   *
>   procedure destroy
>   if this.m_bLoggingOut
>   this.SetLogOff
>   endif
>   if this.m_iConnectionID # -1
>   this.Disconnect
>   endif
>   endproc
>   
>   
>   function GStillExecuting
>   return 0
>   
>   **
>   function GFinished
>   return 1
>   
>   
>   function GNoMoreData
>   return 2
>   
>   **
>   function GSystemTables
>   return "'SYSTEM TABLE'"
>   
>   
>   function GTables
>   return "'TABLE'"
>   
>   ***
>   function GViews
>   return "'VIEW'"
> 
>   
>   function GDBComplete
>   return 1
>   
>   **
>   function GDBPrompt
>   return 2
>   
>   
>   function GDBNoPrompt
>   return 3
> 
>   ***
>   function GTransAuto
>   return 1
>   
>   *
>   function GTransManual
>   return 2
> 
>   **
>   function GAsynchronous
>   return .T.
>   
>   *
>   function GSynchronous
>   return .F.
>   
>   ***
>   function GBatchMode
>   return .T.
>   
>   *
>   function GNoBatchMode
>   return .F.
>   
>   
>   function Connect
>   local m.bRet
>   
>   ? 'COdbc::Connect()'
>   m.bRet = .T.
>   this.m_iConnectionID = SQLCONNECT( this.m_sSourceName,
> this.m_sUserID, this.m_sPassword )
>   ? this.m_iConnectionID
>   if this.m

Re: Visual Foxpro 6

2001-04-05 Thread Petras Virzintas

Hi, it works very well via MyODBC with either SQLCONNECT(), SQLEXEC() into local 
cursors or Remote Views stored in a local VP database.


>From: "Christopher Davis" <[EMAIL PROTECTED]>
>To: "mysqllist" <[EMAIL PROTECTED]>
>Subject: Visual Foxpro 6
>Date: Thu, 5 Apr 2001 10:01:57 +0100

>I wish to use MySQL as a backend to a Visual Foxpro 6 client application, has anyone 
>got any experience of this ? Does it work ?




Re: Visual Foxpro 6

2001-04-05 Thread Lutz Maibach

Hi Christopher,

>>I wish to use MySQL as a backend to a Visual Foxpro 6 client application,
>>has anyone got any experience of this ? Does it work ?
We're using MySQL as backend for our VFP6-Application. It's working with the
MyODBC-Driver but you have to take care about memo-fields and boolean
fields. We're no longer use boolean cause it isn't supported by MySQL. So we
changed to the good old fashioned binary value (tinyint in MySQL) with 0 and
1.

Using Memofields is a bit more tricky cause you have to use text or blob in
MySQL to store their content. MySQL has no problems storing it but when
you're trying to get the data back to VFP you can't use a passthrough select
statement. If you do so VFP handles the content of the blob field as an
object, not as text. For this reason you have to use a view. In the view
definition you can change the type for the blob field from object to memo so
it will be displayed right in VFP.

Oh, I almost forgot the nastiest point up to now, the view definition: When
you create a view with VFP the MyODBC-Driver loads down the complete table
content before showing the dialog where you can choose the fields from the
table structure. If you got a tabelle with a million rows (like we do) you
can spend much time in drinking coffee and walking around before you get
this dialog. So create the views on an empty table and fill them after
creating the view.

Greetings from cloudy Germany

Lutz Maibach
EasyCom GmbH



-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php