"Joseph" <cm******@hotmail.com> wrote in news:130f01c39364$b710f3a0
$a*******@phx.gbl:
If you have some working ADO.Net program to connect to Access
2000 database and add,edit and delete records please post
it.
Here is a *very* small console app that inserts a record into an Access
table. The access database has one table with three fields named
"NumberField","TextField", and "MoneyField".
The app takes each value from the command line and updates the table.
This app doesn't do much but it can connect to an Access database.
(Watch for line wrapping)
'\\\\\\\\\\\\\\\\\
Imports System.Data.OleDb
Module Module1
Private ConnStr As String = "Provider=Microsoft.Jet.OLEDB.4.0;" User
ID=Admin;Data Source=C:\test\db1.mdb;Mode=Share Deny None"
Sub Main(ByVal CmdArgs() As String)
Dim cn As New OleDbConnection(ConnStr)
Dim cmd As New OleDbCommand
With cmd
.CommandType = CommandType.Text
.CommandText = "Insert into Table1 (NumberField, TextField,
MoneyField) " & _
"VALUES (" & CmdArgs(0) & ",'" & CmdArgs(1) &
"'," & CmdArgs(2) & ")"
.Connection = cn
End With
cn.Open()
cmd.ExecuteNonQuery()
cn.Close()
cmd.Dispose()
cn.Dispose()
End Sub
End Module
..///////////////////
Hope this helps,
Chris