473,396 Members | 1,935 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,396 software developers and data experts.

runtime error 3127 on two tables with the same structure

I'm trying to add a field to a bunch of tables that are used to pull the longest record for each field. The program has been working fine for over a year. Now, when I add the field, I get the 3127 error. However, when I check the table for the missing field, the field is there.

In fact, if I go into vba, return the variable containing the full SQL string, copy that into a query Window back in access, and run it with no modifications, IT RUNS! What the heck? Obviously, the two tables are the same, else a query window would error out too.

Here's the SQL statement, thought it works.

Expand|Select|Wrap|Line Numbers
  1. INSERT INTO MAX_FULLNAME_DUMP SELECT * FROM table WHERE len(Trim(Fullname)) in (Select MaxLen from Max_Fullname)
Sep 3 '08 #1
4 5363
puppydogbuddy
1,923 Expert 1GB
I'm trying to add a field to a bunch of tables that are used to pull the longest record for each field. The program has been working fine for over a year. Now, when I add the field, I get the 3127 error. However, when I check the table for the missing field, the field is there.

In fact, if I go into vba, return the variable containing the full SQL string, copy that into a query Window back in access, and run it with no modifications, IT RUNS! What the heck? Obviously, the two tables are the same, else a query window would error out too.

Here's the SQL statement, thought it works.

Expand|Select|Wrap|Line Numbers
  1. INSERT INTO MAX_FULLNAME_DUMP SELECT * FROM table WHERE len(Trim(Fullname)) in (Select MaxLen from Max_Fullname)
Shouldn't "table" be Max_Fullname?

Expand|Select|Wrap|Line Numbers
  1. INSERT INTO MAX_FULLNAME_DUMP 
  2. (SELECT * FROM Max_Fullname
  3. WHERE len(Trim(Fullname)) in 
  4. (Select MaxLen from Max_Fullname))
  5.  
Sep 4 '08 #2
Yes, but that code is only wrong in my example. I guess I started to genericize the code and only changed one instance. My working code reflects your suggestion.
Sep 11 '08 #3
Okay, no something is really odd. I'm getting runtime 3078 errors for files I KNOW are in the database, and table-already-exists errors for tables that have been deleted. I check the MsysObjects table and it's correct, but my form doesn't seem to be seeing what objects exist correctly.
Sep 11 '08 #4
Okay, figured it out; stupid error. Instead of

Expand|Select|Wrap|Line Numbers
  1.  Set dbs = CurrentDb 
I had

Expand|Select|Wrap|Line Numbers
  1.  Set dbs = "C:\MyDatabase.mdb" 
Since the changes I was making have to be made in a second copy to keep the live copy working, I was looking at tables in a totally different database. Duh.
Sep 11 '08 #5

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

Similar topics

0
by: Bill Lawrence | last post by:
I am responsible for maintaining a VB.Net system created by someone who no longer works here. It consists of a VB program running as a Service which collects data from a couple of servers once a...
5
by: Derickson | last post by:
I am working with a production runtime Access 2000 db, split front-end and back-end. Running on a network, I need a nightly copy of the backend transferred to a laptop with a temporary network...
3
by: bill_hounslow | last post by:
I'm trying to transfer data from one Sql Server into a table on another, using a simple INSERT query in an Access database with links to tables on both servers (the reasons for this are complicated...
3
by: chellappa | last post by:
Hi EveryBody! i need a information about creatting structure at runtime.... like example ..... int main() { char *a,*b; printf("Enter the structure"); scanf("%s",a); printf ("Enter The...
8
by: Nanda | last post by:
hi, I am trying to generate parameters for the updatecommand at runtime. this.oleDbDeleteCommand1.CommandText=cmdtext; this.oleDbDeleteCommand1.Connection =this.oleDbConnection1;...
6
by: Bill Patel | last post by:
I am getting Runtime error on line 50. Please Help. Thank You Bill 1 <%@ Page Language="VB" %> 2 <%@ import Namespace="System.Data" %> 3 <%@ import Namespace="System.Data.SqlClient"...
13
by: Jerry C | last post by:
I am using some sample code from gotdotnet to Create DataSet mappings from a xsd schema. I am geting this error. code and error below. I might mention there is also a publictypelibrary file with...
7
by: mike | last post by:
We have numerous Access 97 apps that we run on our Terminal Server, but two apps in particular is giving us a problem. The problem we are running into is when you select a drop down menu, it errors...
3
by: Terry Reedy | last post by:
Stef Mientki wrote: You have gotten the 2.x answer. In 3.0, 0b,0o,0x prefixes are valid and required for binary, octal, and hexadecimal literals. 0digits is invalid. tjr
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: 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
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...
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
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...

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.