473,698 Members | 1,840 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 14533
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
4693
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
4416
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 person number);(translation) STATUS;
2
4962
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
4456
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 code: oleDbDataAdapter1.Fill(dataSet1); However when this line of code executes I get whole page...
3
6885
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 specify a userid (aspnet) no password I get
1
8324
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
2480
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 sure if DLookup is right for this.. anyways, here is the Code
6
3668
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 name is spelled correctly. I deleted the employee parts on purpose because I didnt need it. Where...
2
5432
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
8668
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9152
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9014
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8855
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7708
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5857
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4358
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3037
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
2
2320
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.