数据库引擎找不到表。为什么不? [英] Database engine cannot find table. Why not?

查看:133
本文介绍了数据库引擎找不到表。为什么不?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Microsoft Jt数据库引擎找不到

tblJobSites,错误#3078。这就是我在执行此代码时获得的价值......


Private Sub Command1_Click()

Dim MyWorkspace As工作区

设置MyWorkspace = DBEngine.Workspaces(0)

Dim MyDB作为数据库

Dim MyQueryDef作为QueryDef,MyRecSet作为记录集

Dim MyPeriod As String,MyRand As Double

设置MyDB = MyWorkspace.Databases(0)

设置MyQueryDef = MyDB.CreateQueryDef("")


使用MyQueryDef

''创建临时QueryDef。

.SQL =" SELECT [Period] FROM tblJobsites WHERE [Period] =''M''"

设置MyRecSet = .OpenRecordset()

MyRecSet.MoveFirst

结束


调试报告有问题的行...

设置MyRecSet = .OpenRecordset()


我在这里做错了什么?


(frmProgrammerOnly,Command1按钮单击,deadpest.mdb)

解决方案

我讨厌问明显,但你有一张名为tblJobsites的桌子吗?可能

它实际上是tblJobsite还是其他一些变化?


-

Doug Steele,Microsoft Access MVP
http://I.Am/DougSteele

(没有e请给我们邮件!)


" MLH" < CR ** @ NorthState.net>在消息中写道

新闻:o7 ******************************** @ 4ax.com ...

Microsoft Jt数据库引擎找不到
tblJobSites,错误#3078。这就是我在执行此代码时得到的结果......

私有Sub Command1_Click()
将MyWorkspace作为工作区调暗
设置MyWorkspace = DBEngine.Workspaces( 0)
Dim MyDB作为数据库
Dim MyQueryDef作为QueryDef,MyRecSet作为记录集
Dim MyPeriod作为字符串,MyRand作为双重
设置MyDB = MyWorkspace.Databases(0)
设置MyQueryDef = MyDB.CreateQueryDef("")
使用MyQueryDef
''创建临时QueryDef。
。SQL =" SELECT [Period] FROM tblJobsites WHERE [ Period] =''M''"
设置MyRecSet = .OpenRecordset()
MyRecSet.MoveFirst
结束

调试报告有问题的行...
设置MyRecSet = .OpenRecordset()

我在这里做错了什么?

(frmProgrammerOnly,Command1按钮点击,deadpest.mdb)



MLH< CR ** @ NorthState.net>写道:

Microsoft Jt数据库引擎找不到
tblJobSites,错误#3078。这就是我在执行此代码时得到的结果......

私有Sub Command1_Click()
将MyWorkspace作为工作区调暗
设置MyWorkspace = DBEngine.Workspaces( 0)
Dim MyDB作为数据库
Dim MyQueryDef作为QueryDef,MyRecSet作为记录集
Dim MyPeriod作为字符串,MyRand作为双重
设置MyDB = MyWorkspace.Databases(0)
设置MyQueryDef = MyDB.CreateQueryDef("")
使用MyQueryDef
''创建临时QueryDef。
。SQL =" SELECT [Period] FROM tblJobsites WHERE [期] = '' M '' "


^^^


你忘记了; SQL语句末尾的字符???


设置MyRecSet = .OpenRecordset()
MyRecSet.MoveFirst
结束
调试报告有问题的行......
设置MyRecSet = .OpenRecordset()

我在这里做错了什么?

(frmProgrammerOnly,Command1按钮点击, deadpest.mdb)




-

问候,


布拉德利


基督徒的回应
http:// www。 pastornet.net.au/response




" Br @ dley" < N0 **** @ 4u.com>在消息中写道

news:OV ************ @ news-server.bigpond.net.au ...

MLH< CR**@NorthState.net>写道:
你忘记了;你的SQL语句末尾的字符???




分号不是必需的。


-

Doug Steele,Microsoft Access MVP
http://I.Am / DougSteele

(请不要发电子邮件!)



The Microsoft Jt database engine can not find
tblJobSites, error #3078. That''s what I get when
executing this code...

Private Sub Command1_Click()
Dim MyWorkspace As Workspace
Set MyWorkspace = DBEngine.Workspaces(0)
Dim MyDB As Database
Dim MyQueryDef As QueryDef, MyRecSet As Recordset
Dim MyPeriod As String, MyRand As Double
Set MyDB = MyWorkspace.Databases(0)
Set MyQueryDef = MyDB.CreateQueryDef("")

With MyQueryDef
'' Create temporary QueryDef.
.SQL = "SELECT [Period] FROM tblJobsites WHERE [Period]=''M''"
Set MyRecSet = .OpenRecordset()
MyRecSet.MoveFirst
End With

Debug reports the problematic line ...
Set MyRecSet = .OpenRecordset()

What have I done wrong here?

(frmProgrammerOnly, Command1 button click, deadpest.mdb)

解决方案

I hate to ask the obvious, but do you have a table named tblJobsites? Might
it actually be tblJobsite or some other variation?

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

"MLH" <CR**@NorthState.net> wrote in message
news:o7********************************@4ax.com...

The Microsoft Jt database engine can not find
tblJobSites, error #3078. That''s what I get when
executing this code...

Private Sub Command1_Click()
Dim MyWorkspace As Workspace
Set MyWorkspace = DBEngine.Workspaces(0)
Dim MyDB As Database
Dim MyQueryDef As QueryDef, MyRecSet As Recordset
Dim MyPeriod As String, MyRand As Double
Set MyDB = MyWorkspace.Databases(0)
Set MyQueryDef = MyDB.CreateQueryDef("")

With MyQueryDef
'' Create temporary QueryDef.
.SQL = "SELECT [Period] FROM tblJobsites WHERE [Period]=''M''"
Set MyRecSet = .OpenRecordset()
MyRecSet.MoveFirst
End With

Debug reports the problematic line ...
Set MyRecSet = .OpenRecordset()

What have I done wrong here?

(frmProgrammerOnly, Command1 button click, deadpest.mdb)



MLH <CR**@NorthState.net> wrote:

The Microsoft Jt database engine can not find
tblJobSites, error #3078. That''s what I get when
executing this code...

Private Sub Command1_Click()
Dim MyWorkspace As Workspace
Set MyWorkspace = DBEngine.Workspaces(0)
Dim MyDB As Database
Dim MyQueryDef As QueryDef, MyRecSet As Recordset
Dim MyPeriod As String, MyRand As Double
Set MyDB = MyWorkspace.Databases(0)
Set MyQueryDef = MyDB.CreateQueryDef("")

With MyQueryDef
'' Create temporary QueryDef.
.SQL = "SELECT [Period] FROM tblJobsites WHERE [Period]=''M''"
^^^

Have you forgotten the ; character at the end of your SQL statement???

Set MyRecSet = .OpenRecordset()
MyRecSet.MoveFirst
End With

Debug reports the problematic line ...
Set MyRecSet = .OpenRecordset()

What have I done wrong here?

(frmProgrammerOnly, Command1 button click, deadpest.mdb)



--
regards,

Bradley

A Christian Response
http://www.pastornet.net.au/response



"Br@dley" <n0****@4u.com> wrote in message
news:OV************@news-server.bigpond.net.au...

MLH <CR**@NorthState.net> wrote:
Have you forgotten the ; character at the end of your SQL statement???



The semicolon isn''t required.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)



这篇关于数据库引擎找不到表。为什么不?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆