• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 231
  • Last Modified:

URGENT! Create ODBC Connection

Hi,

I have an app that runs a Crystal Report, the Crystal Report requires an ODBC connection on the pc running the application.

I want to know how I can programatically check for / create the required ODBC connection through code.

Regards
Plucka
0
Plucka
Asked:
Plucka
  • 5
  • 4
  • 2
1 Solution
 
PluckaAuthor Commented:
This tells me how to make a connection string.

I want to add an ODBC connection as in the type you see in control panel.

Regards
Dale Fraser
0
 
checooCommented:
I dont understand your requirement can you elaborate the same.

The code segment in the above link launches the same ODBC wizard, which is accessible from the control panel.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
PluckaAuthor Commented:
I don't want to launch a wizard.

As if I created manually an ODBC connection to a SQL database manually.

I want to be able to do this through code, to check for and create if not there the ODBC entry.

Regards
Plucka
0
 
cyberdevil67Commented:
There are 2 ways to do this...

1) Use the Registry methods to setup the registry, you can do this using the code when the application runs, or you can use the setup wizard to create/remove the registry.

2) You can use a direct connection to the databse rather than go through an ODBC connection.

If the server is local then there is no security issues, but if it is remote and hasn't been setup behind a vpn you will have security issues.

Not use number 2 myself, but number 1 is fairly easy to achieve.
0
 
cyberdevil67Commented:
What I mean is use the OLE DB (ADO) to make a direct connection using Crystal Reports.
0
 
PluckaAuthor Commented:
Option 2 sounds fine as does option 1.

But I have no idea how to do either.

Regards
Plucka
0
 
cyberdevil67Commented:
Option1 is fairly simple and is explained in your MSDN Library.

but Option 2 is that you tell the report to connect via OLE DB (ADO) instead of using an ODBC connection, this way the report itself olds the connection information to the sql server.

If you create a new report and create a new connection you'll see that you can do a number of options, one of these is the OLEDB (ADO) and uses a direct connection.
0
 
PluckaAuthor Commented:
Can an existing report be changed to use an ADO connection?

Regards
Plucka
0
 
cyberdevil67Commented:
Yes you can, if you use the log on log off option you should be able to add and remove the connection to the database.
0
 
PluckaAuthor Commented:
OLE DB ADO method works a treat, thanks.

Regards
Plucka
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 5
  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now