Help deleting fields in SQL table
- From: JEErasmus@xxxxxxxxxxxxxx
- Date: Thu, 28 Jun 2007 03:51:01 -0700
Bear with me here, I'm just learning to use SQL for the first time.
I have a spread*** that pulls in the data from a .dbf database file.
In the spread***, users can rearrange these and export them back to
the database to be picked up by the application which uses them.
Initially I tried creating a new *** with the updated values mixed
in with the original values (some of the original rows of data are
deleted), deleting everything in the table and then refilling the
table with the data from the new ***. BUT one of the fields is a
memo which doesn't translate well to Excel and back again using VBA.
AND it's a stupid way of doing things.
UPDATING. Now I have used and UPDATE statement to update the fields
that already exist in the file.
DELETING FIELDS REMOVED IN EXCEL. I thought I might try deleting
excess records in the dbf file but by doing that while looping through
the (joint) primary keys in VBA, I'll end up deleting everything.
I could create a table listing just the primary keys I want to end up
with, and then link the two tables using some kind of "DELETE FROM
dbftable WHERE Not Exists (SELECT key FROM table2 WHERE
table1.key=table2.key)". The only problem is I don't know how to make
a table from my spread*** in VBA/SQL.
ADDING NEW FIELDS. And here I just have no idea what to do. When users
edit the information they want to, they play about with less than 10
fields (including the primary keys) in one ***, and not the full 71
fields in the original file. I guess I could assign default values,
but not sure how I'd go about this without it becoming cumbersome and
sluggish.
Any help appreciated.
PS It's my birthday, please be nice, I'm getting old here.
.
- Follow-Ups:
- RE: Help deleting fields in SQL table
- From: JLatham
- RE: Help deleting fields in SQL table
- Prev by Date: Re: What is default property of name object
- Next by Date: RE: Merge csv file from many folders
- Previous by thread: Macro doesn't capture all data
- Next by thread: RE: Help deleting fields in SQL table
- Index(es):
Loading