INSERT INTO Deyiminde Sözdizimi Hatası.
-
kodlarım bunlar veri yazmak istediğimde böyle bir hata veriyo ... izinleri verdim dbye ama yine olmadı bi yardım etseniz ?:
Protected Sub kilik_Click1(ByVal sender As Object, ByVal e As System.EventArgs) Handles kilik.Click
Dim ObjConn As OleDbConnection = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;data source=" & Server.MapPath("a.mdb"))
ObjConn.Open()
Dim strSQL As String = "Insert Into users(user,pass,mail,birthdate,regdate,desc) Values ('" & txtuser.Text & "','" & txtpass.Text & "','" & txtmail.Text & "','" & txtbirthdate.Text & "','" & Now & "','" & txtdesc.Text & "')"
Dim ObjRS As New OleDbCommand(strSQL, ObjConn)
ObjRS.ExecuteNonQuery()
ObjConn.Close()
Response.Write("asdsadf")
End Subhata :
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.OleDb.OleDbException: INSERT INTO deyiminde sözdizimi hatası.
Source Error:
Line 39: Dim strSQL As String = "Insert Into users(user,pass,mail,birthdate,regdate,desc) Values ('" & txtuser.Text & "','" & txtpass.Text & "','" & txtmail.Text & "','" & txtbirthdate.Text & "','" & Now & "','" & txtdesc.Text & "')"
Line 40: Dim ObjRS As New OleDbCommand(strSQL, ObjConn)
Line 41: ObjRS.ExecuteNonQuery()
Line 42: ObjConn.Close()
Line 43: Response.Write("asdsadf")
Source File: E:\Inetpub\wwwroot\cnk\kayit.aspx.vb Line: 41
Stack Trace:
[OleDbException (0x80040e14): INSERT INTO deyiminde sözdizimi hatası.]
System.Data.OleDb.OleDbCommand.ExecuteCommandTextForSingleResult(tagDBPARAMS dbParams, Object& executeResult) +267
System.Data.OleDb.OleDbCommand.ExecuteCommandText(Object& executeResult) +192
System.Data.OleDb.OleDbCommand.ExecuteCommand(CommandBehavior behavior, Object& executeResult) +48
System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior behavior, String method) +106
System.Data.OleDb.OleDbCommand.ExecuteNonQuery() +108
zdefteri.WebForm1.kilik_Click1(Object sender, EventArgs e) in E:\Inetpub\wwwroot\cnk\kayit.aspx.vb:41
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +105
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +107
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
-
Şimdi,
strSQL değişkenini
bi textboxun içine yazdır... hemen ardından response.end ile programı durdurki hata vermesin...
sonra textboxun bütün içeriğini kopyala git sql serverdaki query buildera yapıştırıp bi calıştır bakalım, yada hata nerde orada incele...
genellikle tırnak işaretinde problem cıkar...
-
rene hocam output böyle bişey oldu : Insert Into users(user,pass,mail,birthdate,regdate,desc) Values ('gfh','fdgh','fdgh','dfgh','16.05.2008 22:54:26','fdgh')
hata nerde ben bulamadımda ?
-
O sutunların tamamı string dimi?
integer fln değiller...
Eğer yok ise muhtemelen, tarih değişkenini string olarak sokmakla ilgili bi sıkıntı var demektir, tarihi silip öle bi denesene...
eğer o şekilde olursa oraya yazdığın string şeklindeki tarihi convert edip sok sqlin içine...
-
rene hocam cok saolda yine olmadı :( bütün fieldleri string yaptım yemedi. bu arada veritabanı sql deil access mdb ...
aspindirden bi ziyaretci defteri indirdim ondaki bağlantı cümlesini kopyaladım onla oldu yardımların icin cok saol hocam allah razı olsun
-
http://www.tahribat.com/forumdisplayfolder.asp?folderid=48387 şu konudan bişi çıkcagını sanmıorm ama incelersen iyi olur .
zamanında bende cebellesmistim ama bana göre olmadığını anlayınca phpye bir U dönüşü gerçekleşti
-
Bu örneği daha geçen hafta yaptık okulda .NET kullanarak access veri tabanından veri alma olayı.. şuan evde deilim akşam gidince gönderirim.Çok kıl bişi bi boşluk bırakmadından dolayı bile çalışmıyor.
-
yerel ayarlarla ilgilidir. bence tarih formatında problem vardır..
normalde turk formayı gg.aa.yyyy seklindedir
ingilizce ayarlar aa.gg.yyyy seklindedir.
16. ay olmadıgından patlıyo olabilir .
tarihi 1.1.1990 yap gene patlarsa baska hatadır ama muhtemelen localization ayarıdır.. eger problem buysa anlatırım cozumunu.
-
<%
Set foxxly = Server.CreateObject("ADODB.Recordset")
sor = "Select * from tablo"
foxxly.Open sor,Sur,1,3adi=request.form("adi")
foxxly.addnew
foxxly("adi")=adi
foxxly.update
%>şöyle eklesene verilerini. kendine göre düzenle madem access
