Home | Advertising Info95 USERS CURRENTLY ONLINE   
   Site Search Contact Us Friday, March 14, 2025  
 
 


 
ASPProtect
User Management Application with web based screens that allow you to manage users.
www.ASPProtect.com
 
ASPBanner
Banner Rotation system. Advertisers can monitor online statistical reports via their web browsers.
www.ASPBanner.com
 
ASP Photo Gallery
Upload an unlimited amount of albums. Set up categories.Image resizing thumbnail creation.
www.ASPPhotoGallery.com
 
ASPClassifieds
Classifieds system. Set up categories. Users can register themselves. Supports picture uploads.
www.ASPClassifieds.com



DISCUSSION ARCHIVES
 



We didn't realize
the site was so popular.

Other Stuff
 

 
 
Active Server Pages help tutorial how to ASP Help ASP Tutorials ASP Programming ASP Code - ASP Free CJWSoft ASPProtect ASPBanner ASPClassifieds



(Advanced)  (Components)  (Database)  (General)  (Vbscript)




ASPProtect

 
Subject: Opening MSAccess Db from ASP function
From: Wends
Date: 1/31/2001 10:58:06 AM
IP: 213.123.61.53



 

Hi,

I was wondering if anyone could help me. I have created the function openDbConnection as shown below:

Function openDbConnection()

' Declare all variables required
Dim objConn ' Holds the object connection
Dim strConnection ' Holds the connection string

' Define the type of connection
Set objConn = Server.CreateObject("ADODB.Connection")

' Set the connection string and database name
strConnection = "DSN=cdmt;Database=testcdmtDb;"

' Set the username and password
strConnection = strConnection & "UID=sa; PWD=;"

' Open the database connection
objConn.Open strConnection

' Set the return value for the function
openDbConnection = objConn

End Function

Now everytime I want to open the database connection I am making a call to the function as

objConn = openDbConnection()

But when I try to execute a query using the objConn I get an error stating:

Microsoft VBScript runtime error '800a01a8'

Object required: 'objConn'


Is it not possible to open a db connection in this way - if not then are there any suggestions for how I open a db at script level - in a tidy manner??

Many thanks

Wends


 

   Active Server Pages Rule The World
Contact Us  
All artwork, design & content contained in this site are Copyright © 1998 - 2025 PowerASP.com and Christopher J. Williams
Banner ads ,other site logos, etc are copyright of their respective companies.
STATS Unless otherwise noted - All Rights Reserved.

Active Server Pages ASP ASP.NET .aspx .ascx Web HTML Developer Internet Microsoft Web Services Visual Studio .NET CJWSoft ASPProtect ASPBanner ASPClassifieds www.aspclassifieds.com, www.powerasp.com,www.cjwsoft.com,www.aspphotogallery.com,www.codewanker.com,www.aspprotect.com,www.aspbanner.com