insert into hatası alıyorum. sebebi ne olabilir?
Kod:
Dim Cvp As Variant, SQLa As String, SrgYap As QueryDef, Frm As String
Frm = Me.Name
If Len(Dir(Me.strPath, vbNormal)) = 0 Then Cvp = MsgBox("Excel Dosyasi yok.", vbCritical + vbYesNo, "EXCEL DOSYASI"): Exit Sub
Cvp = MsgBox("Tum kayitlar SILINECEKTIR. Kabul mu?", vbCritical + vbYesNo, "OGRENCI TABLO KAYITLARI")
If Cvp <> 6 Then Exit Sub
Me.Caption = "Ogrenci Tablosu SILINIYOR"
CurrentDb.Execute "Delete TbLogrenci.* from TbLogrenci"
Me.Caption = "Ogrenci Excel dosyasina BAGLANIYOR."
DoCmd.TransferSpreadsheet acLink, IIf(SysCmd(acSysCmdAccessVer) = "15.0", acSpreadsheetTypeExcel12, IIf(SysCmd(acSysCmdAccessVer) = "12.0", acSpreadsheetTypeExcel9, acSpreadsheetTypeExcel8)), "ExcelTbLogrenci", Me.strPath, True
SQLa = "INSERT INTO TbLogrenci ( tckimlikno, ogrenciadsoyad, sinifi, okulno, dogumtarihi, dogumyeri, telefonu, okulu, alani, cinsiyeti, ibanNo, il, ilce, mahalle, anneadi, babaadi, velitc, veliadisoyadi, velitelefonu, yakinligi, sosyalgvncesi, evciadresi, ikincidres, kaldigiblok, odano, pansiyonstatüsü ) " & _
"SELECT ExcelTbLogrenci.tckimlikno AS Expr1, ExcelTbLogrenci.ogrenciadsoyad AS Expr2, ExcelTbLogrenci.sinifi AS Expr3, ExcelTbLogrenci.okulno AS Expr4, ExcelTbLogrenci.dogumtarihi AS Expr5," & _
"ExcelTbLogrenci.dogumyeri AS Expr6,ExcelTbLogrenci.telefonu AS Expr7 , ExcelTbLogrenci.okulu AS Expr8, ExcelTbLogrenci.alani AS Expr9, ExcelTbLogrenci.cinsiyeti AS Expr10," & _
"ExcelTbLogrenci.ibanNo AS Expr11, ExcelTbLogrenci.il AS Expr12,ExcelTbLogrenci.ilce AS Expr13, ExcelTbLogrenci.mahalle AS Expr14, ExcelTbLogrenci.anneadi AS Expr15, ExcelTbLogrenci.babaadi AS Expr16," & _
"ExcelTbLogrenci.velitc AS Expr17, ExcelTbLogrenci.veliadisoyadi AS Expr18, ExcelTbLogrenci.velitelefonu AS Expr19," & _
"ExcelTbLogrenci.yakinligi AS Expr20 , ExcelTbLogrenci.sosyalgvncesi AS Expr21, ExcelTbLogrenci.evciadresi AS Expr22, ExcelTbLogrenci.ikincidres AS Expr23," & _
"ExcelTbLogrenci.kaldigiblok AS Expr24 , ExcelTbLogrenci.odano AS Expr25, ExcelTbLogrenci.pansiyonstatüsü AS Expr26, " & _
" FROM TbLogrenci ExcelTbLogrenci ORDER BY [ogrenciadsoyad]"
Me.Caption = "GeciciA sorgusu OLUSTURULUYOR."
Set SrgYap = CurrentDb.CreateQueryDef("GeciciA", Replace(SQLa, "@", Chr(34)))
DoCmd.SetWarnings False
Me.Caption = "Ogrenci Tablosuna VERI YUKENIYOR."
DoCmd.OpenQuery "GeciciA", acViewNormal, acEdit
DoCmd.SetWarnings True
Me.Caption = "Gecici NESNELER SILINIYOR."
DoCmd.DeleteObject acQuery, "GeciciA"
DoCmd.DeleteObject acTable, "ExcelTbLogrenci"
Me.Caption = "ISLEM TAMAM"
Kod:
Set SrgYap = CurrentDb.CreateQueryDef("GeciciA", Replace(SQLa, "@", Chr(34)))