"Joseph" <cm******@hotma il.com> wrote in news:130f01c393 64$b710f3a0
$a*******@phx.g bl:
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.Ole Db
Module Module1
Private ConnStr As String = "Provider=Micro soft.Jet.OLEDB. 4.0;" User
ID=Admin;Data Source=C:\test\ db1.mdb;Mode=Sh are Deny None"
Sub Main(ByVal CmdArgs() As String)
Dim cn As New OleDbConnection (ConnStr)
Dim cmd As New OleDbCommand
With cmd
.CommandType = CommandType.Tex t
.CommandText = "Insert into Table1 (NumberField, TextField,
MoneyField) " & _
"VALUES (" & CmdArgs(0) & ",'" & CmdArgs(1) &
"'," & CmdArgs(2) & ")"
.Connection = cn
End With
cn.Open()
cmd.ExecuteNonQ uery()
cn.Close()
cmd.Dispose()
cn.Dispose()
End Sub
End Module
..///////////////////
Hope this helps,
Chris