Вот код VB
Public Sub AddClient(ByVal abn As String, ByVal companyName As String, _
ByVal contactName As String, ByVal phoneNumber As String, _
ByVal address As String)
'Dim command As OdbcCommand = New OdbcCommand
Using cnx As New OdbcConnection(My.Settings.connectionString)
Using command As New OdbcCommand
command.Connection = cnx
command.CommandText = "sp_InsertClient"
command.CommandType = CommandType.StoredProcedure
'//====== create ABN paramenter =============
Dim param1 As OdbcParameter = New OdbcParameter("inABN", abn)
param1.Direction = ParameterDirection.Input
param1.DbType = DbType.String
'add abn parameter
command.Parameters.Add(param1)
'//====== create CompanyName Parameter ================
Dim param2 As OdbcParameter = New OdbcParameter("inCompanyName", companyName)
param2.Direction = ParameterDirection.Input
param2.DbType = DbType.String
'add the parameter
command.Parameters.Add(param2)
'//======== create ContactName Param ===============
Dim param3 As OdbcParameter = New OdbcParameter("inContactName", contactName)
param3.Direction = ParameterDirection.Input
param3.DbType = DbType.String
'add the parameter
command.Parameters.Add(param3)
'//=========== create PhoneNumber Parameter ===============
Dim param4 As OdbcParameter = New OdbcParameter("inPhoneNumber", phoneNumber)
param4.Direction = ParameterDirection.Input
param4.DbType = DbType.String
'add paramater
command.Parameters.Add(param4)
'//=========== create Address Parameter ===============
Dim param5 As OdbcParameter = New OdbcParameter("inAddress", address)
param5.Direction = ParameterDirection.Input
param5.DbType = DbType.String
'add paramater
command.Parameters.Add(param5)
Try
cnx.Open()
command.ExecuteNonQuery()
Catch ex As Exception
MessageBox.Show(ex.Message, "Error", _
MessageBoxButtons.OK, MessageBoxIcon.Error)
Exit Sub
End Try
End Using
End Using
MessageBox.Show("DONE")
End Sub
А вот мой запрос в Access.
INSERT INTO tblClients ( ABN, CompanyName, ContactName, PhoneNumber, Address )
VALUES ([inABN], [inCompanyName], [inContactName], [inPhoneNumber], [inAddress]);
Спасибо за помощь ...