Connection String

all i am havin a problem with my Jet oleDB connection i am getting an error and i am not sure if my code is completly wrong or it is a small problem any help would be great.

This is the erorr i get:

An unhandled exception of type 'System.TypeInitializationException' occurred in Pizza Project.exe

Additional information: The type initializer for 'Pizza_Project.dataAccess' threw an exception.

This error happens when i try to get the data from my Access 2003 database and put it into a datagrid.

Module dataAccess
Public TotalCost
Public m_strToppings As String
Public m_strPizzaType As String

' Description: link a VB interface with a 2003 Access Database
' This is my connection String
Public constring()

Dim ConnString As String = "Provider=Microsoft.jet.OLEDB.4.0;Data Source" = CStr(Environment.GetFolderPath(Environment.SpecialFolder.Desktop) & "PizzaProject\PizzaDB.mdb")

Dim DBCon As New OleDb.OleDbConnection(ConnString)

Sub OpenDatabaseConnction() 'to open connection

If DBCon.State = ConnectionState.Closed Then
End If
End Sub

Sub CloseDatabaseConnction() 'to close connection

If DBCon.State = ConnectionState.Open Then

End If
End Sub
Function ShowALLCustomerAccountDetails() As DataSet ' To send the info to a datagrid


Dim rs As New ADODB.Recordset()
rs.CursorLocation = ADODB.CursorLocationEnum.adUseClient
rs.CursorType = ADODB.CursorTypeEnum.adOpenStatic
rs.LockType = ADODB.LockTypeEnum.adLockBatchOptimistic

rs.Open("select * from CustomerAccountDetails", ConnString)

rs.ActiveConnection = Nothing


Dim da As New System.Data.OleDb.OleDbDataAdapter()
Dim ds As New DataSet()
da.Fill(ds, rs, "CustomerAccountDetails")
Return ds

End Function

this is the button click event to show the data in the data grid.

Public Class frmEditCustomerDetails

Private Sub btnShowDetails_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnShowDetails.Click
Dim ds As DataSet ' Show details in datagrid

ds = dataAccess.ShowALLCustomerAccountDetails()
With DataGridView1
.DataSource = ds.Tables("CustomerAccountDetails")
End With
End Sub
End Class

MySQL connection string using asp

I am trying to connect to my a MySql database on a Unix server using asp I can successfully connect using php with the following: <?php mysql_connect("localhost", "username", "password"); mysql_select_db("dbname"); $result = mysql_query("SELECT * FROM ...

Javascript ADO Connection String Syntax

can anyone tell me why the connection string for the jscript doesn't work but vbscript does? I'm using IE7 only.------------------------------------ Code Start -----------------------------<html><head><title></title><script language="vbscript">Sub GetVBscriptD ...

connection string of OLE DB for DB2

I am writing c# application to connect to a DB2 database using OLE DB,do any one of u knows the correct format of the connection string, if possible, pls give an example.Much ...

DB2 Connection string problem from VC++

I am using Win 2k and using VC .net (DB2 CLI library) to connect to database. I am currently connecting to server through DSN and it is working fine, but I don't want to make DSN to connect. Instead, I want to use connection string to connect to the database. I gave the following connection string: ...

DB2 ADO.NET Connection String Using DB GROUP

I am having difficulty finding a connection string which will use a DB User Group name rather than the individual user. The client does not want to add DB2 users by individual... and I need to alter the program to accomodate them. The current string, referencing the individual user works fine when r ...

MySQL how to select character set in connection string

i'm using visual basic with mysql and i have a character problem. When i use to get tables with code objects, there is no problem. Because at first i use to execute "Set Names 'latin5';" on my connection. Than i get my table names in orijinal characters. The problem in visual objects that ...

MySQL Directions on Setting up a Connection String

Hi, I am brand new to MySQL. I have the task of developing a website that is being hosted on Unix and my usual MS Access databases cannot be used on it. The Webhosting company already provides access to MySQL as part of the service being offered. I develop websites using Macromedia Dreamweaver MX. M ...

connection string

I've seen a few people who are unfamiliar with MS ODBC technology, and just wanted to throw this out there for them to use.One of the hardest things for me to learn at first was how to build a connection string to a database. There's quite a bit of info that can be put in a connection string, and th ...

C# protected DB connection string

I'm working on a program that interacts with the MySQL database of a website.I have a class for the Database in C# which manages the connection and closing etc. It also stores a constant for the connection string similar to the following example:private const string CONN_STRING = "SERVER=someSe ...

Access Database Connection String & Recordset (Help)

I am passing 3 hidden fields to another page using the method="post"Here is the next page -<%Dim fmMemberID, fmUsername, fmPasswordfmMemberID = request.Form("memberID")fmUsername = request.Form("username")fmPassword = request.Form("password")%><% Dim ...

Change db connection string in web services

I am new to .NET and currently need some help in developing a web service. The connection string inside the web service is fixed but leave the database server name blank. When the client call the web methods from the web service, I need to pass the database server name into the web service. I had tr ...

Connection String for VB to MYSQL

I have difficulty in connecting MYSQL and VB. Would you please help me, give me the connection string for that.? ...

ADO Connection string not working.

I have the following connection string that can't open my database. Does anybody here know what's wrong with this string?char strConnAccess[] = "Driver = {Microsoft Access Driver (*.mdb)};DBQ = C:\\DC2004.mdb;";//I know my program works because I can open it withchar strConnJet[] = "P ...

MySQL Problem connection string authentication to my server

All, I'm having a tough time figuring out the proper connection string to connect to my existing database. Using: * MySQL server 4.0 on a remote Linux Server. * Developing in VS 2005 (VB) on a PC that is apart of our corporate MS domain. * Downloaded and installed Connector/Net 2.0 Problem: I'm usin ...

MySQL Finding the right connection string

I'm new to mySQL (especially the set up part). I've exported my DB as a .sql file: 1) Where on my site is the best place to put the .sql file? Does it have to be anywhere specific? 2) Where can I find the right connection string that I need? Thanks, - MT-=<->=-=<->=-=<->=-=<- ...

MySQL Connection string

Hi, i've modified a connection string to select the correct socket: $connection = mysql_connect(':/var/run/mysqld/mysqld.sock', $url['user'], $ur......................................etc mysql_select_db('astbill' , ':/var/run/mysqld/mysqld.sock') or die('unable to$ return $connection; } butI receive ...

how to prepare DB2 connection string for Biztalk server DB2 adapter

I have Biztalk server 2009 and it has DB2 Adapter to connect DB2 server. I have 2 DB2 environments :1. DB2/iSeries (AS400)2. DB2/NT (developer version on windows 2003 server)When I cofigure Biztalk Server DB2 Adapter, it ask me to enter below connection string parameters and I don't know how to get ...

SQL Server Connection string

Anyone used SQL server with PHP? I need to know the COnnection string and the basic commands... But the connection string mainly ...

UniOleDB hangs on connection string

We are trying to test connection string but it alwasy hangs there forever. We have asp test page and .net vb to test but both are the same thing. I wonder anyone experience this before can give us some help. We are using Unidata 6.0. The asp page that I use is on UniOleDB menu. Sometimes works, most ...

IP Connection String for an instance

I am running SQL Server 7 and SQL Server 2000 on the same box. The following two connection strings both work when I run asp applications from the network.Application("Sales") = "driver=sql server;server=SQL01;database=Sales;uid=SalesUser;p assword=xxxx"Application("Survey ...

ADO connection string

I'd like to establish a WinNT4 -> DB2/MVS connection via the IBM OLE DBProvider for DB2 Servers of the DB2 connect version 7 software bundle.I already was able to access data using a predefined data source createdwith the "Client Configuration Utility". The connection string looked like"Provider= ...

Stinger provider? Connection string for IBMDA400

Two questions:1. What is the provider name used in Stinger? Native IBM provider?2. Has anyone got a working connection string example for use with theIBMDA400 provider? I have never been able to get this provider to work.Running iSeries, V5R2. ...

Protecting Connection String

I have made an application that connects and retrieves records from an online MySQL database, I want to protect the connection info (server address, db user and pw), I've tried to Encrypt it but when i analyze it with Packet Analyzer e.g. WireShark i can see the connection info in there.I need a sec ...

ask for ASP connection string to ODBC

do anyone know the connection string for ASP connect to ODBC?i have created an ODBC for MSSQL named "DMZ-SQL" already. ...

Connection string for SQL Server 2000

I am upgrading my SQL Server 6.5 to SQL Server 2000 and i amusing the following connection string to connect to my SQL Server 6.5database.Provider=sqloledb;Data Source=.;Initial Catalog=emu;User Id=sa;Password=""Do i need to update the provider or any of these settings to connect to SQL Se ...

vbscript connection string

I have been using vbscript for some time now and have been using a MS access database. I now need to access a SQL Server database. I have a datbase called "archive" and we used a script to create the tables with a user called "dicom". When I use a tool to see the tables - they ar ...

ODBC ADO connection string problems: password not saved

I am trying to connect a MS SQL 2005 SSIS package to our Iseries machine using the latest Iseries Access drivers. These include ODBC and ADO connections.However, no matter what I try, the password for connecting to the iseries is not remembered.If I manually enter the password in the connection stri ...

Connection String ???

Which is difference between?CN1 = "PROVIDER=MSDataShape;Data PROVIDER=SQLOLEDB.1" ......and CN2 = "PROVIDER=SQLOLEDB.1" ...... ...

msde jdbc driver connection string

i can't seem to get the right connection string to connect to the msde using microsoft jdbc driver. what i tried is:jdbc:microsoft:sqlserver://\NetSDK:1433;DatabaseName=pubsi also tried use real ip instead of, remove instance name from the connection string, etc. no luck at all. i ...

Is the connection string for SQL Server and MSDE the same?

The connection string I'm currently using for SQL Server is Provider=SQLOLEDB;Server=SERVER\VSDOTNET;Database= CCDDbase;Integrated Security=SSPIwould this be the same query string for MSDE database? I'm quite new in MSDE but I know that except for the tools that comes with SQL Server and its size, t ...