473,403 Members | 2,366 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

How to fix error "3371: Cannot find table or constraint" when creating index?

133 100+
I am attempting to create a table with an index. however, i am receiving an error code "3371: Cannot find table or constraint" as soon as it reads the "create index" statement. The code is as follows"

thank you in advance for any guidance.

Expand|Select|Wrap|Line Numbers
  1.  
  2. strSeqNumber_TEMP = " "
  3. strIndexOrg_TEMP = "0"
  4. strFund_TEMP = " "
  5. strAccountCode_TEMP = "0"
  6. strTotalPrice_TEMP = "0"
  7. strInd_TEMP = "0"
  8. strRuleCode_TEMP = "0"
  9. strSalesOrder_TEMP = "0"
  10. Dim tbl_IDT As DAO.TableDef
  11. Dim idxSeqNumber As DAO.Index
  12.  
  13.  
  14.  
  15. '**** create output table
  16. 'Delete temporary table
  17. DoCmd.RunSQL "DROP TABLE tbl_IDT;"
  18.  
  19. 'Create temporary table
  20. CurrentDb.Execute ("CREATE TABLE tbl_IDT(SeqNumber smallint, IndexOrg smallint, " & _
  21.                                         "Fund VARCHAR(6), " & _
  22.                                         "AccountCode smallint, " & _
  23.                                         "TotalPrice money, " & _
  24.                                         "Ind VARCHAR(1), " & _
  25.                                         "RuleCode VARCHAR(6),  " & _
  26.                                         "SalesOrder numeric)")
  27.  
  28.  
  29.  DoCmd.RunSQL "CREATE INDEX idxSeqNumber ON tblIDT (SeqNumber) WITH PRIMARY"
  30.  
Feb 2 '11 #1

✓ answered by Rabbit

Your table is named tbl_IDT in the create table statement but you're trying to create an index on table tblIDT.

But the real question is why are you dropping the table and recreating it?

2 6757
Rabbit
12,516 Expert Mod 8TB
Your table is named tbl_IDT in the create table statement but you're trying to create an index on table tblIDT.

But the real question is why are you dropping the table and recreating it?
Feb 2 '11 #2
dowlingm815
133 100+
Thanks for the fresh eyes!
Feb 2 '11 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

17
by: MLH | last post by:
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...
1
by: Matthew Louden | last post by:
I am trying to implement the sort event in data grid. I set the data grid's AllowSorting property = True. I implement the following code that should be the event will fire when the user click any...
3
by: POL8985 | last post by:
The application is developed in ASP.Net with a SQL Server database. Essentially, the application uses a single shared Connection object for all users logged into the system. The connection...
5
by: meenasamy | last post by:
Hi all i have used a script that i downloaded and uses the fopen($url,'r'); function to access a url to retrieve data and i get this error Fatal error: fopen(): Unable to find the wrapper...
0
by: Bob | last post by:
Just thought I'd share my experience today with this error message. I received it when doing an .update on a recordset .add. The fieldname that the error message included wasn't even in the table...
1
by: OrionLee | last post by:
I am using C# to work with a 3rd party DLL (Nevron Charts), and attempting to serialise it. The serialisation itself is handled somewhere inside the DLL, so to get it to happen you call the Nevron's...
2
by: embarkr | last post by:
I am getting the error: "Violation of PRIMARY KEY constraint 'PK_tblCustomsTariffTreeMap'. Cannot insert duplicate key in object 'dbo.tblCustomsTariffCodeTreeMap'." However, the record I am...
3
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,...
2
by: Gilles Ganault | last post by:
Hello I'm trying to use urllib to download web pages with the GET method, but Python 2.5.1 on Windows turns the URL into something funny: ======== url = "amazon.fr/search/index.php?url=search"
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
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,...
0
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...
0
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,...

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.