Imports System.Data.OleDb
Partial Class Registrazione
Inherits System.Web.UI.Page
Dim cn As OleDbConnection
Dim cmd As OleDbCommand
Dim dr As OleDbDataReader
Dim icount As Integer
Dim str As String
Protected Sub bInvia_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles bInvia.Click
cn = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("NOMEDELMIODATABASE.mdb"))
cn.Open()
str = "INSERT INTO TABELLA VALUES ('" & tIndirizzo.Text & "')"
'string stores the command and CInt is used to convert number to string
cmd = New OleDbCommand(str, cn)
icount = cmd.ExecuteNonQuery
******* 'L' ERRORE E' PROPRIO NELLA STRINGA DI DI SOPRA
--- Errore di sintassi nell'istruzione INSERT INTO. ---
OLEDBEXCEPTION NON è STATA GESTITA DAL CODICE UTENTE
MsgBox(icount)
'displays number of records inserted
cn.Close()
End Sub
End Class
SPERO DI ESSERE STAO CHIARO.
GRAZIE PER L' ATTENZIONE SPERO CHE QUALCUNO MI AIUTI.