Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using ODBC for Crystal Reports in Foxpro

Status
Not open for further replies.

oarshad

Programmer
Jun 16, 2003
6
0
0
US
I am calling a crystal report using Access Database files from visual Foxpro 7. Initially, I worked on D drive. But when I copy my program on any other computer on C or E or anyother drive. It shows error in Connection String.

Can you tell me how to set up the database location for each table used in crystal report using ODBC data?
 
You don't need to use ODBC. Crystal Reports can natively use Access databases. If you still want to use ODBC, you need to change the DSN to point to the data.

Craig Berntson
MCSD, Visual FoxPro MVP, Author, CrysDev: A Developer's Guide to Integrating Crystal Reports"
 
After working for a quit long time, I found the way how to point the report to the database saved on different location. I don't know if it is the appropriate way, but it still works.

I am using Connect String to connect to my database. When in the program I changed the connectionbufferstring,

Report.Database.Tables.Item(1).ConnectionBufferString = "**** connection string ****"
it gives an error:

but this instead worked and in connection string I can define the location for my database;
.Tables.Item(1).ConnectionProperties.Name('Connect String')="my string"

I didn't define the password in connection string above, I think that didn't work so I had to use this function below to attach password.
.Tables.Item(1).SetLoginInfo("Server","Database","user","pass")


If any comes out with better idea please tell me.
 
You can check the Crystal Reports articles on my web site for additional ideas.

Craig Berntson
MCSD, Visual FoxPro MVP, Author, CrysDev: A Developer's Guide to Integrating Crystal Reports"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top