473,414 Members | 1,677 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,414 software developers and data experts.

How to mask vbscript DB connection in ASP.net 2.0

I am using ASP.net 2.0 and I wanna use some vbscript to get data. But I dun want to dispaly the DB connection string when the users right click the page and view the sources.

I tried this method but not work. (It works in ASP.net 1.0)
1. Add AspCompat="true" at the top of the page, use <!--#include virtual="common/DBconn.inc"--> to define a variable
<%
Const DB_CONNECT_STRING = "PROVIDER=MSDASQL;XXXXXXXX%>

<script language="vbs">
set adocon=CreateObject("ADODB.Connection")
'Set the connectionstring
adocon.ConnectionString =DB_CONNECT_STRING


</script>

Any idea??
May 16 '08 #1
6 1680
Plater
7,872 Expert 4TB
You're using ASP.NET.

Do it in the "code behind" page.

http://www.google.com/search?source=...P.NET+tutorial
May 16 '08 #2
Can you give me more details in code?

Since I tried to put the connection string value in the hidden value, but it still can be browsed by the source code.
May 19 '08 #3
DrBunchman
979 Expert 512MB
Hi ting ting,

I'm a bit confused by this; why you are using VBScript to access your database?

Database access is a server side function so should be written using ASP.NET which, as it runs on the server, can not be seen by viewing the source on the client.

Are you sure you are structuring your code in the right way? Or have I missed something!?

Dr B
May 19 '08 #4
Plater
7,872 Expert 4TB
Hmm yes, putting the connection objects in vbscript will make the client computer generate the connection to the database and not the server.

Are you sure you are even doing ASP at all? Sounds like regular old html with vbscript.
May 19 '08 #5
Thanks for your reply. Since I wonder calling the function by vbscript is faster than generate at server and less refresh and post-back between servers.
Any other suggestions on the masking or ideas to reduce the "refresh"??
As I can mask the connection in ASP 1.0 but dunno why not in ASP 2.0??

Hmm yes, putting the connection objects in vbscript will make the client computer generate the connection to the database and not the server.

Are you sure you are even doing ASP at all? Sounds like regular old html with vbscript.
May 20 '08 #6
DrBunchman
979 Expert 512MB
The database connection MUST be opened on the server and therefore must be opened using server side code.....I don't understand how using client side vbscript is saving you time here!

I store all my connection strings in my web.config file which can be accessed by my server side code and is in no danger of being seen by any users.
May 20 '08 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: A Ratcliffe | last post by:
As you might have gathered from the Subject, I've been experimenting with using VBScript classes in my ASP pages to tidy the script up. Generally things are going well. Since I come from a C++...
8
by: Dave Thomas | last post by:
I have developed a web site using asp pages that use both vbscript and javascript. Run the site on my PC and everything is fine. Ftp to my web hosting provider which hosts asp pages and look on my...
2
by: Pippen | last post by:
Below is a code snippet that is throwing the following error: Error Source: Microsoft DTS Package Error Description: Error Code: 0 Error Source= Microsoft VBScript runtime error Error...
2
by: Jessard | last post by:
Help! Hi, I'm having a bit (well a lot - it's getting annoying) of trouble using a C# class library within a VBScript on a computer other than the development machine. All the class is needed...
4
by: chris.dunigan | last post by:
I'm looking for an example of how to execute an existing DTS­ package from an ASP (VB)script and would appreciate any and all response. ­I don't even know if it's possible Thanks - Chuck...
3
by: pjglick | last post by:
I am sorry if this sounds hokey but I am a newbie to ASP. I have a VBScript running in an ASP page. The script makes a connection to Oracle via and ADODB connection. When my clients connect...
5
by: Zalek Bloom | last post by:
Hello, I am developing a simple ASP application with VBScript and Access database. I am testing it on my Win98SE machine using Personal Web Server. My machine is Celeron 2000 with 512Mb RAM. On...
7
by: skeddy | last post by:
In a nutshell, I'm trying to dynamically create a select box with ResultSet code in vbscript and then need to be able to access the value of that select box later with a Save button. I've got...
0
by: thisis | last post by:
Hi All, I'm getting an error on my ASP page: Microsoft VBScript runtime error '800a000d' Type mismatch: 'StoreFileIntoField' I assume - 99.5% - the error is generated because of worng...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.