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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Remote Database Connection

Status
Not open for further replies.

MrRich36

Technical User
Nov 20, 2009
6
US
Hi,
I currently have my connection string to MS SQL Server located in the global.asa file. I am wanting to make this connection less accessable. Are there any suggestions and examples?

Thanks
Lewis
 
Please explain more on "...make this connection less accessible..."

-DNG
 
Instead of having the connection code to the database located in the global.asa I want to maybe put it in a com object or some type of VBScript class.

I want to keep anyone who may come across that file (global.asa) or any file from finding the connection string.

 
Create a dll and use it to query your db. Place all the connection information within the dll.

DBName
ServerName
UserName
Password

Compile it and archive the source code somewhere safe.

--------
GOOGLE is a great resource to find answers to questions like "how do i..."

If you don't know exaclty what you want to do or what to search on, try Google Suggest: --------
I have recently been semi-converted to ensuring all my code (well most of it) works in both javascript and non-javasc
 
vicvirk,
sounds exactly like what I want to do but I have the slightest idea of how to do that. Could you direct me to examples of how to do that? I have Visual Studio 2005 only because I use SQL Server but I know nothing when it comes to dll and com and making my own exe files.

Thanks
 
It's not as easy as it sounds, there is a lot of work required.

Visit the C# Forum to find out how you can create a DLL that returns a recordset to your ASP page. The best way to achvive it is to ensure ALL your queries are run through stored procedures and the DLL will execute the stored procedure.

Sometimes you may want to simply do an update in which case you don't need to return a record set, but in some instances you may want to return a record set or XML data to do something with on the ASP Page.

C# Forum

Or you could simply encrypt your .asp pages and all the code, not the safest menthod, but it could be a short-term solution.






--------
GOOGLE is a great resource to find answers to questions like "how do i..."

If you don't know exaclty what you want to do or what to search on, try Google Suggest: --------
I have recently been semi-converted to ensuring all my code (well most of it) works in both javascript and non-javasc
 
Thanks guys,
You all have been helpful. I have just been reminded of the OLD DSN method which should do the trick for me. Though I have to create a username and password for each database owner and pass that information along, this should be enough for now. At least I don't have to pass the server IP address and my main admin password and ID.

Thanks guys!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top