Database access

  • Thread starter Thread starter atif
  • Start date Start date
A

atif

i need help on how to create database connectivity, insert, delete,
search n update commands, using both sql n microsoft access, n i 'll
b greatly thankful if u guyz can tell me how to use lookup tables as
used in Delphi thanx.
 
For Microsoft go to: www.microsoft.com/data

atif said:
i need help on how to create database connectivity, insert, delete,
search n update commands, using both sql n microsoft access, n i 'll
b greatly thankful if u guyz can tell me how to use lookup tables as
used in Delphi thanx.



----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption
=---
 
To connect to an MS Access database with ADO.NET we use the OldDB data
providers (OleDB Namespace).

This example uses the Jet 4.0 driver which is the latest Jet version
and the one you should be using. If you need to upgrade your JET
drivers you can do so here
http://www.microsoft.com/data/download_Jet4SP3.htm


<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.OleDb" %>

<SCRIPT LANGUAGE="vb" Runat="server">
Sub Page_Load()
Dim dbRead as OleDbDataReader
Dim sConnectionString As String
Dim PathInfo as string
PathInfo = "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=Z:\database.mdb"
Dim con as OleDbConnection = new OleDbConnection(PathInfo)
Dim SQL as String = "Select * from Users Order By LastName"
Dim da as OleDbCommand = new OleDBCommand(SQL,Con)
con.open
dbRead = da.ExecuteReader()
WHILE dbRead.Read()
response.write (dbRead("FirstName") & " ")
response.write (dbRead("LastName") & "<BR>")
End While
dbRead.close
Con.close
End Sub
</SCRIPT>
 
This will not satisfy the OP because he wanted to be able to do Updates,
therefore he will need to use the DataAdapter/DataSet configuration rather
than a simple reader.

Regards - OHM
 
Back
Top