473,729 Members | 2,234 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Please Help with database upate. New to database

Just some questions regarding tables. I am new Access Database and need a
little help. I have the following data listed below
01. I have a table called tbl_Customer with the following information
listed below
02. In that table I have three columns that have numeric data in it (City,
State, Marital_Status)
03. I need to convert the numeric data in table tbl_customer (City, State,
Marital_Status) to alpha numeric data
04. using the following tables to help convert the numeric data to alpha
numeric
05. tbl_City, tbl_State, and tbl_Marital_Sta tus has the following data
listed below.

Example:

Tbl_Customer
Lname Fname DOB Address City State
Marital_Status
Doe John 01/01/1942 123 Olson Dr 036 042 04
Tbl_City
City_CD City_Name
036 Santa Monica
037 Dallas
038 New York
Tbl_State
State_CD State
042 Texas
051 Kansas

Tbl_marital_sta tus
Marital_CD marital_status
01 Married
02 Single
03 Widowed
04 Divorced
Someone had suggested to me that I could possibley use an update query to
perform this task. can anyone provide an example on how to do this. Any
and all help in regards to this is greatly appreciated.

Thanks,

Argus
Jul 18 '06 #1
17 2026
Personally, I think you're going normalization crazy. Been there, done
that. =)
Use a query. Just join Customer to City table, State table, and
Marital status table and then show the fields you want. And you're
done.

Jul 19 '06 #2
Thanks for the advice, it worked very well.I do have another question to ask
if you don't mind,

I have a table called tbl_memberSSN. In this table it only has a list of
member SSN. How can I search the master query table to see if those member
SSN are in the master query table and do the following:

1. If it finds the member SSN then create a new table called tbl_Match with
all the memberSSN that it found with all of the data in the master query.

2. If it doesn't find the memberSSN in it, then create a new table called
tbl_NoMatch with only the memberSSN that it did not find in the master
query table.

Any and all help is greatly appreciated.

Argus
<pi********@hot mail.comwrote in message
news:11******** **************@ m79g2000cwm.goo glegroups.com.. .
Personally, I think you're going normalization crazy. Been there, done
that. =)
Use a query. Just join Customer to City table, State table, and
Marital status table and then show the fields you want. And you're
done.

Jul 19 '06 #3
I have a table called tbl_memberSSN. In this table it only has a list of
member SSN. How can I search the master query table to see if those member
SSN are in the master query table and do the following:

1. If it finds the member SSN then create a new table called tbl_Match with
all the memberSSN that it found with all of the data in the master query.

2. If it doesn't find the memberSSN in it, then create a new table called
tbl_NoMatch with only the memberSSN that it did not find in the master
query table.

Any and all help is greatly appreciated.

Argus
I'm puzzled. Why do you need a distinct table of SSNs? To implement
data security? Then force the users to access your tables through
views. I mean, I could answer your question, but I get the feeling
that it may not be helping.

Why are you creating lots of tables? Will queries not suffice for what
you need to do? (What are you trying to do, in business terms?)

you can do #1 with an inner join. and #2 with an outer join or the
"Find Unmatched" query wizard.

But again, what are you trying to achieve? I suspect you're making
things much harder than they need to be.

Jul 19 '06 #4
I didn't do a good job of explaining on what it is I am trying to do. I am
new to databases and doing alot of reading and OJT.

This is what I am trying to do: I need to search a table or query for
specific information. I am given a list to use as my search criteria to
search that master query. The list is given to me in a text file. I import
that text file into my database as tbl_UserSearch and I want to do the
following:

001. I want to use tbl_UserSearch to search the Master_query
002. Find all matches and create a new table called tbl_MatchesFoun d.
003. tbl_MatchesFoun d is created and used to export the information to
Excel to be used by others.
004. The other items not found is ported to a new table called
tbl_NoMatches
005. tbl_NoMatches is used to inform the requestors that those items not
found need to be worked.

tbl_MatchesFoun d and tbl_NoMatches do not have to be tables, I guess they
could be queries as long as I can export that data into excel.

again, all help is greatly appreciated.

Argus
<pi********@hot mail.comwrote in message
news:11******** **************@ h48g2000cwc.goo glegroups.com.. .
I have a table called tbl_memberSSN. In this table it only has a list
of
member SSN. How can I search the master query table to see if those
member
SSN are in the master query table and do the following:

1. If it finds the member SSN then create a new table called tbl_Match
with
all the memberSSN that it found with all of the data in the master
query.

2. If it doesn't find the memberSSN in it, then create a new table
called
tbl_NoMatch with only the memberSSN that it did not find in the master
query table.

Any and all help is greatly appreciated.

Argus

I'm puzzled. Why do you need a distinct table of SSNs? To implement
data security? Then force the users to access your tables through
views. I mean, I could answer your question, but I get the feeling
that it may not be helping.

Why are you creating lots of tables? Will queries not suffice for what
you need to do? (What are you trying to do, in business terms?)

you can do #1 with an inner join. and #2 with an outer join or the
"Find Unmatched" query wizard.

But again, what are you trying to achieve? I suspect you're making
things much harder than they need to be.

Jul 20 '06 #5

OdAwG wrote:
I didn't do a good job of explaining on what it is I am trying to do. I am
new to databases and doing alot of reading and OJT.

This is what I am trying to do: I need to search a table or query for
specific information. I am given a list to use as my search criteria to
search that master query. The list is given to me in a text file. I import
that text file into my database as tbl_UserSearch and I want to do the
following:

001. I want to use tbl_UserSearch to search the Master_query
002. Find all matches and create a new table called tbl_MatchesFoun d.
003. tbl_MatchesFoun d is created and used to export the information to
Excel to be used by others.
004. The other items not found is ported to a new table called
tbl_NoMatches
005. tbl_NoMatches is used to inform the requestors that those items not
found need to be worked.

tbl_MatchesFoun d and tbl_NoMatches do not have to be tables, I guess they
could be queries as long as I can export that data into excel.

again, all help is greatly appreciated.

Argus
Oh, I get it now. So you essentially have a "temporary" dataset (your
newly imported data) and you have to see what it matches/does not
match? If that's the case, you can create queries to do all this for
you. If the records exist in two tables, you can just have a join
between them. Given tables A and B, in Oracle-speak, it would look
like this:

SELECT tblA.Field1, tblB.Field2 <whatever fields you want to see>
FROM tblA, tblB
WHERE tblA.Field1 = tblB.Field2; <---- these are your inner joins

If you want to find the records that are in one table but not in
another, just use an outer join (that's what the find unmatched query
wizard does).

It's something like:

SELECT tblA.Field1, ...
FROM tblA LEFT JOIN tblB ON tblA.Field1=tbl B.Field2
WHERE tblB.SomeField IS NULL;

The data that's not in table B will be Null, so you can find on that if
there are no matches.

So there's no need for any other table than your real data tables (the
"temp" one and your "existing records" one). You can export the
queries wherever you want. Just treat them like tables. I think the
only difference is that you specify the type as table instead of query.
Other than that, everything works the same.

Jul 20 '06 #6
Works like a charm, thanks for the expert advice.

I'm so sorry to ask you another question, you've been such a great help,
however, is there a way to automatically import text/excel files into Access
tables or query. what I would like to do is when I launch my database, it
would automatcially import the text files or excel files.

Argus

<pi********@hot mail.comwrote in message
news:11******** **************@ m73g2000cwd.goo glegroups.com.. .
>
OdAwG wrote:
I didn't do a good job of explaining on what it is I am trying to do. I
am
new to databases and doing alot of reading and OJT.

This is what I am trying to do: I need to search a table or query for
specific information. I am given a list to use as my search criteria to
search that master query. The list is given to me in a text file. I
import
that text file into my database as tbl_UserSearch and I want to do the
following:

001. I want to use tbl_UserSearch to search the Master_query
002. Find all matches and create a new table called tbl_MatchesFoun d.
003. tbl_MatchesFoun d is created and used to export the information to
Excel to be used by others.
004. The other items not found is ported to a new table called
tbl_NoMatches
005. tbl_NoMatches is used to inform the requestors that those items
not
found need to be worked.

tbl_MatchesFoun d and tbl_NoMatches do not have to be tables, I guess
they
could be queries as long as I can export that data into excel.

again, all help is greatly appreciated.

Argus
Oh, I get it now. So you essentially have a "temporary" dataset (your
newly imported data) and you have to see what it matches/does not
match? If that's the case, you can create queries to do all this for
you. If the records exist in two tables, you can just have a join
between them. Given tables A and B, in Oracle-speak, it would look
like this:

SELECT tblA.Field1, tblB.Field2 <whatever fields you want to see>
FROM tblA, tblB
WHERE tblA.Field1 = tblB.Field2; <---- these are your inner joins

If you want to find the records that are in one table but not in
another, just use an outer join (that's what the find unmatched query
wizard does).

It's something like:

SELECT tblA.Field1, ...
FROM tblA LEFT JOIN tblB ON tblA.Field1=tbl B.Field2
WHERE tblB.SomeField IS NULL;

The data that's not in table B will be Null, so you can find on that if
there are no matches.

So there's no need for any other table than your real data tables (the
"temp" one and your "existing records" one). You can export the
queries wherever you want. Just treat them like tables. I think the
only difference is that you specify the type as table instead of query.
Other than that, everything works the same.

Jul 21 '06 #7

OdAwG wrote:
Works like a charm, thanks for the expert advice.

I'm so sorry to ask you another question, you've been such a great help,
however, is there a way to automatically import text/excel files into Access
tables or query. what I would like to do is when I launch my database, it
would automatcially import the text files or excel files.

Argus
the way I would handle it is something like this:
1. create import specifications for your text files.
2. Always put the files to be imported into the same folder.
'---code these---
3. loop through the contents of the folder (from step 2), and import
the files.
4. any files successfully imported should be moved to a different
folder. (use Rename) The failed ones should go in another folder.

Sorry, getting brain damage... this is most of it... I've commented out
the parts that aren't working yet. Oh, the BrowseFolder API... that's
here:

http://www.mvps.org/access/api/api0002.htm

Here's my code so far...

Public Sub ImportFilesInDi rectory(ByVal strExtension As String)
Dim strOriginalPath As String
Dim strFinalPath As String

Dim strFinalFile As String
Dim myFile As String

strOriginalPath = BrowseFolder("S elect a folder to process")
strFinalPath = BrowseFolder("S elect a folder to move processed
files to:")

myFile = Dir(strOriginal Path & "\*." & strExtension)
strFinalPath = strFinalPath & "\" & myFile

'---Loop through the files in the folder (strPath)
Do While myFile <""
'---handle Text and Excel files differently...
If strExtension = "txt" Then
DoCmd.TransferT ext acImportDelim, "MySpecificatio nName",
"DestinationTab le", myFile, False
'Name "c:\origfile.tx t" As "c:\newfile.txt " <---NEEDS
REPAIR
ElseIf strExtension = "xls" Then
DoCmd.TransferS preadsheet acImport,
acSpreadsheetTy peExcel9, "DestinationTab le", myFile, True
End If

'---run the "move file" code here...

myFile = Dir
Loop
End Sub

Jul 21 '06 #8
Hey,

is there a way when you do a macro to import a text file, that you can
create the field name. Example:
Inside the mem.txt file

There is no header

12345
12346
32165
32154
98756
98567

when i create the macro, I perform the following:
001. Click on MACROS
002. Clicked on New
003. Under ACTION select TransferText
004. Under Action Arguments selected the following:
01. Transfer Type --Importe Delimited
02. Specification Name --<blank>
03. Table Name --tbl_SearchMemNu m
04. File Name --c:\dir\folder\M emNum.txt
05. Has Field Names --NO
06. HTML Table Name --<blank>
07. Code Page --<blank>
005. Save the macro as M_Import_MemNum

When importing is done and I looked inside the table, it has as the field
name as F1 with all the numbers under it
When I change Line 004 step 05 to Yes, it puts the first member number in
the file as the Field Name.

How can I set the field name to what I need it to be during import. I will
have the same problem with the other text files that I will also be
importing.


"OdAwG" <Od***@goneloos e.comwrote in message
news:9p******** *****@tornado.t exas.rr.com...
Just some questions regarding tables. I am new Access Database and need
a
little help. I have the following data listed below
01. I have a table called tbl_Customer with the following information
listed below
02. In that table I have three columns that have numeric data in it
(City,
State, Marital_Status)
03. I need to convert the numeric data in table tbl_customer (City,
State,
Marital_Status) to alpha numeric data
04. using the following tables to help convert the numeric data to alpha
numeric
05. tbl_City, tbl_State, and tbl_Marital_Sta tus has the following data
listed below.

Example:

Tbl_Customer
Lname Fname DOB Address City State
Marital_Status
Doe John 01/01/1942 123 Olson Dr 036 042 04
Tbl_City
City_CD City_Name
036 Santa Monica
037 Dallas
038 New York
Tbl_State
State_CD State
042 Texas
051 Kansas

Tbl_marital_sta tus
Marital_CD marital_status
01 Married
02 Single
03 Widowed
04 Divorced
Someone had suggested to me that I could possibley use an update query to
perform this task. can anyone provide an example on how to do this. Any
and all help in regards to this is greatly appreciated.

Thanks,

Argus


Jul 21 '06 #9
Unless your first row contains field names, you can't. well, not with
a macro. If you wanted to rename the fields, you could do it in
ADO/DAO and probably regular old ALTER TABLE commands with SQL.

Are you importing files with an unkown number of fields or something?
Kinda weird, because databases depend on standardized structures...

Jul 22 '06 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
2585
by: James | last post by:
Please help - getting very desperate! Sun, 12 October 2003 05:39 I have PHPDEV 4.2.3 from Firepages.com.au as the upgrade to 4.3.0 did not work. I also had an abortive download from PHP.NET as I could not configure Apache myself. The REAL problem is that PHPmyAdmin works and sees my test database Wines.... But my PHP program does not!
5
1476
by: DraguVaso | last post by:
Hi, I thought it isn't possible to use a SqlDataAdapter and a Databound grid when there isn't a 'real' primary key on the table. Although, is there a way to use it, and define somewhere in the SqlDataAdapter my own primary key on the table? I can't add a primary key to the table, so I guess that's the only way to find a solution?
4
2585
by: dave | last post by:
Hi guys I display one page in popup window...that fetches some data from sql and perfom some calculation (tht approx 10 secs) and display result.... I am trying to display "Please wait ..."message while its performing calculation... I'm using the below code...that i have got from following link http://aspfaq.com/show.asp?id=2498 but somehow it doesnt work and displays nothing....it display only for a second before the actual result is...
5
1315
by: joshnosh | last post by:
I have two tables tblLogin and tblTrades I have 3 fields in each table, for thr purpose of this question tblLogin Fields are MemberNo RegNo Country tblTrades fields are
3
5570
by: Paolo | last post by:
Hi, I am trying to compact and repair my database, however every time I try it comes up a message saying: Table: "TempMSysAccessObject already exists", whenever I try to look for this table I cannot find it anywhere... Any clues... Already went into the help file and nothing... Also try to copy my database and the same message comes up
13
4334
by: Joner | last post by:
Hello, I'm having trouble with a little programme of mine where I connect to an access database. It seems to connect fine, and disconnect fine, but then after it won't reconnect, I get the error "operation is not allowed when object is open" so I take out the line of code: BookDetails.Connection1.Open and it comes up with the error "operation is not allowed when object
0
1083
by: Larry | last post by:
"<Knowledge GID="fff0be9b-6326-4098-9945-fe825cb7fc66" Name="Knowledge" Description="The root of your knowledge hierarchy." />" The above a simple xml text file and I would like to store it into a memo field in a access database. Assume these xml text is stored in strXML string variable and following codes do n't work as " is a park of the xml text. What can I do? UPATE ABC SET ABC.XMLTEXT = '" & strXML & "'"
0
1787
by: mark d. | last post by:
I'm using a formview control to display/edit/insert data that is populated from an sqldatasource. One of the values is a pipe delimited string that represents multiple items. Within the edititemtemplate for this field I have a label and checkboxlist. Within the checkboxlist databound event I take the label and split up the string then set the appropriate checkboxes to selected. My question is how to update this field. I've looked...
6
1082
by: brett | last post by:
Has any one been able to successfully install Web Application support for VS.NET 2005 on Vista: http://www.microsoft.com/downloads/details.aspx?familyid=8B05EE00-9554-4733-8725-3CA89DD9BFCA&displaylang=en The upate installs but the ASP.NET web application project never shows up when I select to create a new project. I can't open an existing web app projects either. Thanks,
0
8913
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8761
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9426
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9280
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9200
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8144
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6722
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6016
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4525
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...

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.