Data base connection

  • Thread starter Thread starter Herb
  • Start date Start date
H

Herb

I am having a problem with syntac. I want to connect and
open an access database.
the path to the database is
e:\webanimalhome\database\data.mdb

I am using the following code. All I get is errors and
how does it know how to fine the database. The database
is on a remote web server.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0
Transitional//EN">
Imports System
Imports System.Data
Imports System.Data.SqlClient
Imports Microsoft.VisualBasic
<%@LANGUAGE="VBSCRIPT"%>
<% Dim objCnn As New SqlConnection( _
"Initial Catalog=data;Data" & _
"Data
Source=localhost;uid=animalhome;pwd=gooddog")

objCnn.Open()

%>
 
Hi There

Make sure the path to your .mdb file is correct. You can
ask the Administrator of the Hosting machine to provide
you these details. After knowing the path , username and
password for the .mdb file use the following connection
string for connecting to the database

"Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=\somepath\mydb.mdb;Jet OLEDB:Database
Password=MyDbPassword;","admin", ""

Gopi
 
Back
Top