setting keys and indexes

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is it possible to set a primary key and index programatically? I'm importing
a very large file into my database and cannot set these items manually
because some fields contain blanks.

What I would like to do is delete the rows with blanks and then set the
primary key and index after these items have been deleted.

Is this possible or do you have any other suggestions on how to accomplish
this? Thanks for the help.
 
JT said:
Is it possible to set a primary key and index programatically? I'm
importing a very large file into my database and cannot set these
items manually because some fields contain blanks.

What I would like to do is delete the rows with blanks and then set
the primary key and index after these items have been deleted.

Is this possible or do you have any other suggestions on how to
accomplish this? Thanks for the help.

You can do what you ask, or as an alternative you could set the table's
primary key at design time, then link to the file you want to import and
run an append query to copy its records into the table. Records that
don't have valid values for the key field will be rejected.

I'd be inclined to take this approach, rather than make design changes
at run time. But if you want to do that, post back and I'll scrounge up
some code for you.
 
I can try your approach because so far nothing has worked. Thanks for the
help.
 
JT said:
I can try your approach because so far nothing has worked. Thanks
for the help.

Incidentally, if you know that your problem is that some imported
records have blanks in required fields, you can set up your append query
with criteria that exclude those records.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top