Solved

CGI Application to connect to SQL Server

Posted on 2002-05-01
9
168 Views
Last Modified: 2010-04-04
Hi,

Can someone give me an example of connecting to an SQL Server through a CGI app?  I've built my basic application, but each time I try to connect to the database, I get this error: "Unknown database. Alias: MOONTERRA"

I'm using Apache on MS Windows 2000 Pro in CGI mode (not ISAPI).

Any help greatfully accepted :)

Cheers

Stu
0
Comment
Question by:Stuart_Johnson
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 2
9 Comments
 
LVL 4

Expert Comment

by:Greg Rowland
ID: 6984224
Listening.

This is something I have been planning to try, are you testing this locally or across the Internet?
0
 
LVL 6

Author Comment

by:Stuart_Johnson
ID: 6984648
Locally and live.  

Stu
0
 
LVL 7

Expert Comment

by:Motaz
ID: 6985304
Why you are using Aliases, it is better to use ADO, I try it with many CGI applications and it works fine.

Motaz
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 6

Author Comment

by:Stuart_Johnson
ID: 6985457
When I try it with ADO I get the error:

[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified

My connection string clearly states it though.

Provider=MSDASQL.1;Persist Security Info=False;User ID=SA;Data Source=MOONTERRA

Any ideas?

Stu
0
 
LVL 7

Expert Comment

by:Motaz
ID: 6985570
I'm using: Provider=SQLOLEDB.1;

make sure that Data Source (Moonterra) is accessible for the Apache user name.
0
 
LVL 7

Accepted Solution

by:
Motaz earned 100 total points
ID: 6985575
Example of complete connection string:
  'Provider=SQLOLEDB.1;Password=' + MyPassword +
';Persist Security Info=True;User ID=' + UserNam +
    ';Initial Catalog=Test;Data Source=' + ServerName;
0
 
LVL 6

Author Comment

by:Stuart_Johnson
ID: 6985978
Hi Motaz,

Thanks for that!  Worked perfectly!

Stu
0
 
LVL 4

Expert Comment

by:Greg Rowland
ID: 6986926
Listening.

This is something I have been planning to try, are you testing this locally or across the Internet?
0
 
LVL 6

Author Comment

by:Stuart_Johnson
ID: 6987503
You already asked that :)
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Suggested Courses
Course of the Month3 days, 15 hours left to enroll

630 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question