.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

create and open global database connection object

Posted By:      Posted Date: October 06, 2010    Points: 0   Category :ASP.Net

Hi to everyone:

I`m trying to install the allinta cms software www.allinta.com, I have already create a MySQL Data Base, but when I try to launch my cmsadmin I t appears an error

Microsoft VBScript runtime error '800a01f4'

Variable is undefined: 'dbConnectionStr'

/cmsadmin/inc/db_connection.asp, line 75

IT  seems to be the Object Connection, could somebody help me to give the right code instruction please, I don´t have an idea on how to make it.

At this moment I opened in dreamweaver and it´s

Set objConn = Server.CreateObject("ADODB.Connection")

View Complete Post

More Related Resource Links

How to declare a global connection object?

Following the post on declaring a global variable 'theDate' with a defined date format to be used across the web pages, I now encounter another tricky question: Is there a way to declare a global connection object so that I can avoid repeating the same statements (SqlConnection myconn = new SqlConnection(Class1.conn); myconn.Open();) in all the coding page that require a database connection? Thanks.

How to create a connection to Access Database

Hi guys, I want to create a report from Access Database. Can anybody tell me how to connect and create a data source from Access data source. A step by step guide is preferable. I am more concerned on the connection string. Thanks.

claims authenticated (FBA) user cannot open a connection to our custom application database

We have designed a custom sharepoint site. This site uses a membership provider that I implemented, and the users are stored in our custom application database. These are the steps I follow to reproduce the error: 1. Browse to our site. Select Forms Authentication from the default.aspx selection. 2. Enter in a username from our DB table. This user I have configured as a site collection administrator. 3. Login to the site. The user is authenticated by our membership provider and allowed access (ValidateUser returns true) 4. Browse to a page that attempts to connect to the custom app DB. 5. I get the following error when the page attempts to open a connection to our DB: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server NOTES: The code that opens the DB connection is running with SPSecurity.RunWithElevatedPrivileges. Our application pool account has access to the database. My user can connect to the database fine as well as the user that our  application pool is running as. I have validated the connection string that is being used in the debugger, and that is correct.

How to create global object and let everybody use it and several questions


i want to create a global object and my all users should be using it


here comes several questions


my web server is working like a web farm

there is hosted only 1 website but it has 12 w3wp.exe 

my session state is aspnet_state


so if i use global object how many times will it be created

i mean how does this thing works


also all users will be excessively accessing this object

would this cause problem ?


and how can i create this object and use it


also can this object be hash table


thank you

Database Connection is a managed object or unmanaged object??


Hi All,

            I am confused over this point that Connection with databse in ado.net is a managed object or unmanged object, from the past couple of years i was assuming that it is unmanged but  a post from MSDN says it is managed (Correct me if i am wrong :)), i am attching the link of that post herewith

please find  -----> :Note Do not call Close or Dispose.................... in the below Link


Thanks in Advance,


Failed to create a database object


Hello Friends,


I am receiving the following error:

"Failed to create a database object. Please contact your system administrator".


Environment: JSP Application accessing from chrome, SQL 2000, Resin Server.


Last Activity: Re-installation of sql server 2000. Restore of database.




Is There Other Methods to Create and INSERT data into A SQL Database besides ADODB.Connection


OK - I have everything working on my Production computer to find out that when I upload my page to my Shared Hosting Server, to find out my application will not work because I do not have high enough permissions to for aspcompat to be true.

This works on my development server which of course I have full access to:


        'Creating Connection Object and opening the database
        con = Server.CreateObject("ADODB.Connection")

        'Done. Close the connection
        con = Nothing
        Response.Write("Your Information was Successfully Added.")


Is there another method to execute my  sql string (which contains my INSERT INTO statement, and is in my .vb code file ) with just a Medium Access Level?  Other wise I will have to purchase a Dedicated server, which currently I can not really afford!


If open Database Connection fail how to try again Reopen?



I am using this few lines of codes but when connection fail it never succes open again any idea? 


Dim sConnectionString As String = ConfigurationManager.ConnectionStrings("DatabaseConnectionString").ConnectionString
        Dim objConn As New SqlConnection(sConnectionString)
        For f = 1 To 1
                objConnOpenError = False
                objConnOpenError = True
            End Try
            If objConnOpenError = True Then
                System.Diagnostics.Debug.WriteLine("Error objConn85 " & Now)
                f = 0

Connestion string create any database server

This links important to how to create connection string to any data base sever.

Create/add table from code to database



I create table:

                  DataSet data=new DataSet();

                  DataTable myTable = new DataTable("NewTable");

                   DataColumn[] keys = new DataColumn[1];

                   // create column
                   keys[0] = new DataColumn();
                   keys[0].DataType = System.Type.GetType("System.String");
                   keys[0].ColumnName = "PointID";
                   myTable.Columns.Add(keys[0]);    &nb

how create database?????


I want to make databas? that will send daily to all members that leave email?Please if you can help me

Unable to make connection to database?


Hy guys. I try to connect my database for so long so i wrote two type of codes. Let's discuse first on.

I have database called PhoneDirectory.

It have only one table named Residents.

I have button wiht ID="Button1".

I want when i click this button to see all of my residents. 

I want to see the result in DetailsView and to be able to edin, delete and add new resident.

First try with SqlDataSource so i wrote this:

<asp:SqlDataSource ID="Resident Details" runat="server" ProviderName="System.Data.SqlClient" ConnectionStrings="<%$ ConnectionStrings:ThisIsTheConnection%>" 
              SelectCommand = "SELECT * FROM Resident "

Need Oracle Data Provider .CS File for Oracle 10g Database connection !



I need a 'Wrapper.cs' file which takes care of the Database connection ( Oracle 10g) where

i can just call the method with my SQL Query


Gridview1.DataSource = SampleWrapper.ExecuteDatatable("THE SQL QUERY");


Plz Post the link if there is any open source !    

Yukon Basics: XML, T-SQL, and the CLR Create a New World of Database Programming


The next version of SQL Server, code-named "Yukon," includes quite a few enhancements and expanded language support. For example, Transact-SQL now conforms more closely to the ANSI-99 SQL specification and makes querying more flexible and expressive. Yukon can execute user-defined functions, stored procedures, and triggers written in CLR-targeted languages, including Visual Basic .NET and C#. It supports a subset of the W3C standard XQuery language, and has native XML support.In this article, the author outlines the most significant language features and builds an order-entry sample app.

Eric Brown

MSDN Magazine February 2004

Protect It: Safeguard Database Connection Strings and Other Sensitive Settings in Your Code


Protecting application secrets, such as database connection strings and passwords, requires careful consideration of a number of pertinent factors such as how sensitive the data is, who could gain access to it, how to balance security, performance, and maintainability, and so forth. This article explains the fundamentals of data protection and compares a variety of techniques that can be used to protect application settings. The author discusses what to avoid, such as hiding keys in source code and the use of Local Security Authority. In addition, he presents some effective solutions such as the Data Protection API.

Alek Davis

MSDN Magazine November 2003

Metadata: Create a Database Schema Repository with Meta Data Services in SQL Server 2000


SQL Server 2000 Meta Data Services is a repository technology that stores and manages metadata for SQL Server. Instead of building database schemas over and over, Meta Data Services allows you to freeze an entire schema for use in other projects. You can also use these schemas for training, testing, or debugging. In this article, the authors will review the various components of Meta Data Services and show how it can be programmed using a Visual Basic client, XML, and XSLT. They will also show you how to manage and manipulate your metadata by generating a simple database schema using a SQL Server repository.

Alok Mehta and Ricardo Rodriguez

MSDN Magazine May 2003

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend