Código PHP:
<%@ Page Language="VB" Debug="True" %>
<%@ import Namespace="System.Data" %>
<%@ import Namespace="System.Data.OleDb" %>
<script runat="server">
Dim cadena As String = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("cliente1.mdb;")
Sub boton_Click(Sender As Object, E As EventArgs)
Dim conexion As new OleDbConnection(cadena)
Dim insertar As OleDbCommand = new OleDbCommand()
insertar.Connection = conexion
insertar.CommandText = "INSERT INTO cliente (login,password) VALUES (@variable1, @variable2)"
insertar.Parameters.Add("@variable1", OleDbType.VarChar, 50).Value = textbox1.value
insertar.Parameters.Add("@variable2", OleDbType.VarChar, 50).Value = textbox2.value
Try
conexion.Open()
insertar.ExecuteNonQuery()
Catch ex as Exception
Message.Text = ex.ToString()
Finally
conexion.Close()
End Try
End Sub
</script>
<html>
<head>
</head>
<body>
<form runat="server">
Textbox1: <input type="text" id="textbox1" runat="server">
Textbox2: <input type="text" id="textbox2" runat="server">
<input type="submit" OnServerClick="boton_Click" value="Agregar" runat="server">
<asp:Label id="Message" runat="server" width="80%" ForeColor="red" EnableViewState="false"></asp:Label>
</form>
</body>
</html>
Código PHP:
System.Data.OleDb.OleDbException: Error de sintaxis en la instrucción INSERT INTO. at System.Data.OleDb.OleDbCommand.ExecuteCommandTextErrorHandling(Int32 hr) at System.Data.OleDb.OleDbCommand.ExecuteCommandTextForSingleResult(tagDBPARAMS dbParams, Object& executeResult) at System.Data.OleDb.OleDbCommand.ExecuteCommandText(Object& executeResult) at System.Data.OleDb.OleDbCommand.ExecuteCommand(CommandBehavior behavior, Object& executeResult) at System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior behavior, String method) at System.Data.OleDb.OleDbCommand.ExecuteNonQuery() at ASP.insertar2_aspx.boton_Click(Object Sender, EventArgs E) in C:InetpubwwwrootOverlayinsertar2.aspx:line 21