Re: Foxpro and crystal 9 - data location at runtime



I believe I have found a solution to the problem.
In case anyone is interested, I had to use the following statement :

crpDatabaseTables(1).ConnectionProperties.Add "SourceDB", strNewLocation

This must only be done on the first table in the report (hence the (1) index
above).

I suspect that the property to set is very dependant on the odbc driver that
is used. It seems some databases (eg access) immediately show you all (or
most) of the properties that you can set (including the database location),
however in the visual foxpro odbc driver case, there are only a couple of
properties available and none are for the database location. I found the
"SourceDB" property in the registry entry for DSN.


"TPG" <me@xxxxxxxxxxx> wrote in message news:43740a77$1@xxxxxxxxxxxxxxxxxxxx
> I have upgraded to crystal 9, and am having problems with my vb code which
> sets the database location. This code worked fine with crystal 8.
>
> My reports use an ODBC connection to the foxpro data (free tables). In
> crystal 8 I used this syntax :
> crpDatabaseTable.SetLogOnInfo "Visual Foxpro Tables", "DBQ=" &
> strNewLocation
>
> Under Crystal 9 this doesnt seem to work and I get unable to logon errors.
>
> I have also tried using the ole db provider for visual foxpro, and this
> allows me to set the location in code without problems, however whenever
> there is a date range clause in the record selection I get an error
message
> saying "Column 'DATETIME' is not found. On viewing the sql clause in the
> crystal report, it has included this as part of the where clause, eg :
> `TRANS`.`trandate`>=CONVERT(DATETIME, '01-01-2003', 110)
>
> I have moved away from using direct connection to foxpro data due to
> performance issues with the direct driver (odbc is much faster and uses
> indexes better), so I dont want to go backwards if I can help it.
>
> Has anyone been able to get odbc or oledb connections working with foxpro
> tables, AND been able to set the data location at runtime successfully ?
>
> HELLPPPP!!! PLEASE !!!
>
> thanks:)
>
>


.



Relevant Pages

  • Re: Word mail merge with foxpro
    ... I did come across an article about using FoxPro with earlier Word ... > The dbf is not attached to a dbc as I have always found that more ... The MDAC 2.5 installaion helpded greatly I am just a bit worried ... >> is to switch on ODBC logging in the ODBC administrator. ...
    (microsoft.public.word.mailmerge.fields)
  • Re: Linking to ODBC in A2003 aborts
    ... Do you have an ODBC driver for FoxPro installed? ... Server I'd have to buy a new computer and install Access on it. ... It's really easy to connect to those tables in A97. ...
    (comp.databases.ms-access)
  • Re: Access import off Fox Pro Tables
    ... I am having an issue installing the visual fox pro driver. ... and try to install from the link you provided, I am getting the error "The ... How can I get this VFP odbc driver? ... > Start with the latest ODBC driver for FoxPro and Visual FoxPro, ...
    (microsoft.public.access.externaldata)
  • Re: VFP 8 and ODBC connection
    ... Using ODBC in a Foxpro ... dedicated application server and the database part of the software on ... I have tried giving full access to all the folders available read, ...
    (microsoft.public.fox.helpwanted)