Re: Foxpro and crystal 9 - data location at runtime
- From: "Mike" <me@xxxxxxxxxxx>
- Date: Tue, 15 Nov 2005 12:13:17 +1000
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:)
>
>
.
- References:
- Prev by Date: Re: Change Datasource report programaticaly
- Next by Date: Table fields do not show up
- Previous by thread: Foxpro and crystal 9 - data location at runtime
- Next by thread: VS 2005 and CR deployment problem??
- Index(es):
Relevant Pages
|