|
-
Feb 12th, 2016, 06:38 AM
#11
Re: INSERT INTO without field names
 Originally Posted by saranmc
@techgnome, rstInsert.Fields(.Name) cannot be nothing. Because i am updating/ inserting into a table. That means I am inserting into a field that has some value. So adding some new records at the end. So can the value of the field be nothing?? I dont think so.. Please correect me if I am wrong...
I said to check to see if the FIELD is nothing, not it's value.... but I can see the confusion.
Here's what I see and no code anywhere in this thread will solve it ... you have two tables... table tblImport and tblTarget ... you have run into a case where tblTarget has a field that tblImport does not ... ok.... so you loop through tblImport, build up a string of fields and insert into tblTarget....the case above is the reverse problem... there is a field in tblImport THAT IS NOT IN tblTarget. Just like you cannot select from a field that doesn't exist, you cannot insert into a field that doesn't exist. That's what the error on this line:
rstInsert.Fields(.Name).Value = .Value
was telling you... you were trying to assign a value to a field that simply put did not exist. It's like asking for an appointment on the 30th of February ... no matter how you put it, that simply cannot be done as the date just doesn't exist.
Personally I think you're working with either a crap requirement, or a crap design... I'm leery of anything that just allows users to arbitrarily upload anything they want with out some kind of standards or a set of rules that have to be played by. I know systems that allow the uploading of data, heck, that's what I'm working on in my day job at the moment, but there are usually some kind of processes and rules that have to be played by... this just sounds way too arbitrary.
-tg
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|