Data base connection

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Herb

    #1

    Data base connection

    I am having a problem with syntac. I want to connect and
    open an access database.
    the path to the database is
    e:\webanimalhom e\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.Sql Client
    Imports Microsoft.Visua lBasic
    <%@LANGUAGE="VB SCRIPT"%>
    <% Dim objCnn As New SqlConnection( _
    "Initial Catalog=data;Da ta" & _
    "Data
    Source=localhos t;uid=animalhom e;pwd=gooddog")

    objCnn.Open()

    %>
  • S Gopikrishna

    #2
    RE : Data base connection

    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=Micro soft.Jet.OLEDB. 4.0;Data
    Source=\somepat h\mydb.mdb;Jet OLEDB:Database
    Password=MyDbPa ssword;","admin ", ""

    Gopi
    [color=blue]
    >-----Original Message-----
    >I am having a problem with syntac. I want to connect[/color]
    and[color=blue]
    >open an access database.
    >the path to the database is
    >e:\webanimalho me\database\dat a.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.Sql Client
    >Imports Microsoft.Visua lBasic
    ><%@LANGUAGE="V BSCRIPT"%>
    ><% Dim objCnn As New SqlConnection( _
    > "Initial Catalog=data;Da ta" & _
    > "Data
    >Source=localho st;uid=animalho me;pwd=gooddog" )
    >
    > objCnn.Open()
    >
    >%>
    >.
    >[/color]

    Comment

    Working...