Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/tfs/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
正在尝试将我的vb.net 2019连接到access2010_Vb.net - Fatal编程技术网

正在尝试将我的vb.net 2019连接到access2010

正在尝试将我的vb.net 2019连接到access2010,vb.net,Vb.net,我一直在da.Fill(ds,“用户”) 这是我经常遇到的错误: System.Data.OleDb.OleDbException HResult=0x80040E14 Message=Syntax error in FROM clause. Source=System.Data StackTrace: at System.Data.OleDb.OleDbCommand.ExecuteCommandTextErrorHandling(OleDbHResult hr) at System.Da

我一直在
da.Fill(ds,“用户”)

这是我经常遇到的错误:

System.Data.OleDb.OleDbException HResult=0x80040E14 Message=Syntax error in FROM clause. Source=System.Data StackTrace: at System.Data.OleDb.OleDbCommand.ExecuteCommandTextErrorHandling(OleDbHResult 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.ExecuteReader(CommandBehavior behavior) at System.Data.OleDb.OleDbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior) at System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable) at Praise_Baptist_Int.School.Login.Login_Load(Object sender, EventArgs e) in C:\Users\PEPRAH\source\repos\Praise Baptist Int. School\Form1.vb:line 36 at System.EventHandler.Invoke(Object sender, EventArgs e) at System.Windows.Forms.Form.OnLoad(EventArgs e) at System.Windows.Forms.Form.OnCreateControl() at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible) at System.Windows.Forms.Control.CreateControl() at System.Windows.Forms.Control.WmShowWindow(Message& m) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.ScrollableControl.WndProc(Message& m) at System.Windows.Forms.ContainerControl.WndProc(Message& m) at System.Windows.Forms.Form.WmShowWindow(Message& m) at System.Windows.Forms.Form.WndProc(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) System.Data.OleDb.OLEDBEException HResult=0x80040E14消息=FROM子句中的语法错误。Source=System.Data StackTrace:at 位于的System.Data.OleDb.OleDbCommand.ExecuteCommandTextErrorHandling(OleDbHResult hr) System.Data.OleDb.OleDbCommand.ExecuteCommandTextForSingleResult(tagDBPARAMS dbParams,Object&ExecuteSult)位于 System.Data.OleDb.OleDbCommand.ExecuteCommandText(对象和ExecuteSult)位于 System.Data.OleDb.OleDbCommand.ExecuteCommand(CommandBehavior,Object&ExecuteSult)位于 位于的System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior,String方法) 位于的System.Data.OleDb.OleDbCommand.ExecuteReader(CommandBehavior) 位于的System.Data.OleDb.OleDbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior) 位于的System.Data.Common.DbDataAdapter.FillInternal(数据集数据集、数据表[]数据表、Int32 StartRecords、Int32 maxRecords、字符串srcTable、IDbCommand命令、CommandBehavior) 位于的System.Data.Common.DbDataAdapter.Fill(数据集数据集、Int32 startRecord、Int32 maxRecords、字符串srcTable、IDbCommand命令、CommandBehavior行为) System.Data.Common.DbDataAdapter.Fill(数据集数据集,字符串srcTable)位于 表扬浸礼会国际学校。登录。登录\u加载(对象发送者,事件参数e)在C:\Users\PEPRAH\source\repos\表扬浸礼会国际学校\Form1.vb中:第36行 System.EventHandler.Invoke(对象发送方,EventArgs e)位于 System.Windows.Forms.Form.OnLoad(EventArgs e)位于 位于的System.Windows.Forms.Form.OnCreateControl() System.Windows.Forms.Control.CreateControl(布尔值fignorevible)位于 位于的System.Windows.Forms.Control.CreateControl() System.Windows.Forms.Control.WmShowWindow(Message&m)位于 System.Windows.Forms.Control.WndProc(Message&m)位于 System.Windows.Forms.ScrollableControl.WndProc(Message&m)位于 System.Windows.Forms.ContainerControl.WndProc(Message&m)位于 System.Windows.Forms.Form.WmShowWindow(消息和m)位于 System.Windows.Forms.Form.WndProc(Message&m)位于 System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message&m)位于 System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message&m)位于 System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr-hWnd、Int32-msg、IntPtr-wparam、IntPtr-lparam)
问题大概是“User”是您正在使用的SQL风格中的保留字。如果您在看似有效的SQL中遇到语法错误,这是最有可能的解释。您需要对其进行转义,以强制将其解释为标识符。在Jet/accesssql中,可以通过将其包装在括号中来实现这一点,即

从[用户]中选择*
值得注意的是,这正是您在VB中使用保留字作为标识符所做的,例如

Public Class [Event]
    '...
End Class
Public Class [Event]
    '...
End Class