473,554 Members | 3,102 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Database engine cannot find table. Why not?

MLH
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.Worksp aces(0)
Dim MyDB As Database
Dim MyQueryDef As QueryDef, MyRecSet As Recordset
Dim MyPeriod As String, MyRand As Double
Set MyDB = MyWorkspace.Dat abases(0)
Set MyQueryDef = MyDB.CreateQuer yDef("")

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

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

What have I done wrong here?

(frmProgrammerO nly, Command1 button click, deadpest.mdb)

Nov 13 '05 #1
17 14516
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**@NorthStat e.net> wrote in message
news:o7******** *************** *********@4ax.c om...
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.Worksp aces(0)
Dim MyDB As Database
Dim MyQueryDef As QueryDef, MyRecSet As Recordset
Dim MyPeriod As String, MyRand As Double
Set MyDB = MyWorkspace.Dat abases(0)
Set MyQueryDef = MyDB.CreateQuer yDef("")

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

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

What have I done wrong here?

(frmProgrammerO nly, Command1 button click, deadpest.mdb)

Nov 13 '05 #2
Br
MLH <CR**@NorthStat e.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.Worksp aces(0)
Dim MyDB As Database
Dim MyQueryDef As QueryDef, MyRecSet As Recordset
Dim MyPeriod As String, MyRand As Double
Set MyDB = MyWorkspace.Dat abases(0)
Set MyQueryDef = MyDB.CreateQuer yDef("")

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.MoveFi rst
End With

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

What have I done wrong here?

(frmProgrammerO nly, Command1 button click, deadpest.mdb)


--
regards,

Bradley

A Christian Response
http://www.pastornet.net.au/response
Nov 13 '05 #3

"Br@dley" <n0****@4u.co m> wrote in message
news:OV******** ****@news-server.bigpond. net.au...
MLH <CR**@NorthStat e.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!)


Nov 13 '05 #4
MLH
Its a fair Q. Yes, it has 604 records in it.
I backed it up in the same dbase ==>
tblJobsitesBAKU P.
Nov 13 '05 #5
MLH
Have tried both with and without the semicolon.
Same err rtnd either way.
xxxxxxxxxxxxxxx xxxxxxxxxxxxxxx xxxxxx

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

Set MyRecSet = .OpenRecordset( )
MyRecSet.MoveFi rst
End With

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

What have I done wrong here?

(frmProgrammerO nly, Command1 button click, deadpest.mdb)


Nov 13 '05 #6
MLH
The precise error message...

Run-time error '3078':
The Microsoft Jet database engine cannot find the input table or query
'tblJobsites'. Make sure it exists and that its name is spelled
correctly.

I have copied the table to another table named 'a' and tried the same
code again. It reports not being able to find 'a' as well. I have
closed and reopened the database. Perhaps there's something
wrong with my code syntax. I would appreciate you checking.
Nov 13 '05 #7
MLH
Notice if I slightly change the SQL assignment to this...
Private Sub Command1_Click( )
Dim MyWS As Workspace
Set MyWS = DBEngine.Worksp aces(0)
Dim MyDB As Database
Dim MyQD As QueryDef, MyRecSet As Recordset
Dim MyPeriod As String, MyRand As Double
Set MyDB = MyWS.Databases( 0)
Set MyQD = MyDB.CreateQuer yDef("SELECT [Period] FROM tblJobsites
WHERE [Period]='M';")

With MyQD
' Create temporary QueryDef.
' .SQL = "SELECT [Period] FROM tblJobsites WHERE [Period]='M';"
Set MyRecSet = .OpenRecordset 'This line gave me prob -
Access said it couldn't find tblJobsites. Why?
MyRecSet.MoveFi rst
End With

You see where I rem'd out the .SQL assignment in the With clause?
I put it in a few lines up - just before the With statement. Debog
reports the exact same error, citing that line as the problematic
line. How can the Set MyQD line fail??? I just don't understand.
Nov 13 '05 #8
MLH
Also, if I remove the square brackets from the Period fieldname in the
SQL statement, the error is different and occurs on a different
line...

Private Sub Command1_Click( )
Dim MyWS As Workspace
Set MyWS = DBEngine.Worksp aces(0)
Dim MyDB As Database
Dim MyQD As QueryDef, MyRecSet As Recordset
Dim MyPeriod As String, MyRand As Double
Set MyDB = MyWS.Databases( 0)
' Set MyQD = MyDB.CreateQuer yDef("SELECT [Period] FROM tblJobsites
WHERE [Period]='M';")
Set MyQD = MyDB.CreateQuer yDef("SELECT Period FROM tblJobsites
WHERE Period='M';")

With MyQD
' Create temporary QueryDef.
' .SQL = "SELECT [Period] FROM tblJobsites WHERE [Period]='M';"
Set MyRecSet = .OpenRecordset 'This line gave me prob -
Access said it couldn't find tblJobsites. Why?
MyRecSet.MoveFi rst
End With
Runtime error 3067...
Query input must contain at least one table or query.

Debug reports this as the problematic line...
Set MyRecSet = .OpenRecordset
Nov 13 '05 #9
MLH
I compacted the database to db1.mdb and repaired it
successfully. Then I opened db1 and ran this code again...

Private Sub Command1_Click( )
Dim MyWS As Workspace
Set MyWS = DBEngine.Worksp aces(0)
Dim MyDB As Database
Dim MyQD As QueryDef, MyRecSet As Recordset
Dim MyPeriod As String, MyRand As Double
Set MyDB = MyWS.Databases( 0)
' Set MyQD = MyDB.CreateQuer yDef("SELECT [Period] FROM tblJobsites
WHERE [Period]='M';")
Set MyQD = MyDB.CreateQuer yDef("SELECT Period FROM tblJobsites
WHERE Period='M';")

With MyQD
' Create temporary QueryDef.
' .SQL = "SELECT [Period] FROM tblJobsites WHERE [Period]='M';"
Set MyRecSet = .OpenRecordset 'This line gave me prob -
Access said it couldn't find tblJobsites. Why?
MyRecSet.MoveFi rst
End With
This time the error returned was different...
Run-time error 3012...
Object "SELECT Period FROM tblJobsites WHERE Period="M';" already
exists.

Am I not exiting the Workspace? What's going on. If I stop & restart
Access, this error is not the first, but you can bet it'll be the
second if I run the code again in the same instance of Access.
Nov 13 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
4679
by: Paul | last post by:
Hello, I know there are other messages concerning this error message, but they all look so confusing to me. I have an application that uses an Access database. No problems with permissions. I made a windows service of that application. I choose 'ServiceAccount.LocalService' in the ProjectInstaller (VS.NET) which means Anonymous User.
0
4411
by: Dejan M. | last post by:
Please can you help me with this problem: In the next form, when I Add new person who is not registered in the base I had the massage: The Microsoft Jet database engine cannot find a record in the table 'CLAN' with key matching field(s) JMBG. The question is: How to add data for the unregistered visitors in the next fields: JMBG (unique...
2
4957
by: dskillingstad | last post by:
I'm building a tracking system and I'm having some problems. I thought this was relatively easy, but.... I have the following tables and fields (abbreviated): tblPermitMain PermitID - pk ApplicantID (from tblApplicant) PropertyID (from tblProperty) PermitNumber PermitApprovalDate
5
4447
by: Dave | last post by:
This is my first .NET project (although I am experienced with VS6 and InterDev). I am simply trying to set up a basic ASPX project and connect to an Access database (following the instructions in the .NET Black Book by Templeman and Vitter). I have managed to set up an oleDbConnection, an oleDbAdapter and a dataset, and have added one line of...
3
6880
by: Neal | last post by:
Hi All I am trying to connect from ASP.Net app to an Access Db. If i don't specify a userid an pwd.. I get this error The Microsoft Jet database engine cannot open the file 'C:\Documents and Settings\rogersn\My Documents\EEECourses.mdb'. It is already opened exclusively by another user, or you need permission to view its data." If i...
1
8320
by: babyjek | last post by:
SELECT ProjectID, ProjectName, ProjectDescription, SequenceNumber, LastUpdateDate FROM Project WHERE ProjectID = @ProjectID; (The Microsoft Jet database engine cannot find the input table or query 'Project'. Make sure it exists and that its name is spelled correctly.)
3
2473
gcoaster
by: gcoaster | last post by:
Hello! I am having problem with DLookup Function DLookup looks on form, and finds the combobox = cboFullName and then compares it to the column clientID in tblCLIENTS table. if they match, email is put in text box on form named clientEmail and the control source for that field is linked to a table tblCALLS and clientEmail column. Not...
6
3656
by: warpcon | last post by:
Im trying to build a database starting with one of the templates that come with access. I took out the employee part in all the tables and forms. Now when I pull up a workorder and then try to view the report on it it gives me the message " Ms jet database engine cannot find the input table or query ' Employees'. Make sure it exists and that its...
2
5428
by: =?Utf-8?B?c25henp5?= | last post by:
I have created an web application using Visual Studio 2008. The application works OK in Debug. However it does not work after publish. The following message appers "The Microsoft Jet database engine cannot open the file '\\192.168.0.2\Test\Test.mdb'. It is already opened exclusively by another user or you need permission to view its data".
0
7519
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
1
7560
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7887
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6140
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5431
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3545
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2015
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1130
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
838
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.