Query Table Information With T-SQL

Sep 12, 2005

I have been looking all over for the answer to this and can't find the slightest thing about it.

I need to know how I can query information about what tables are in a MS Access database. Lets say for example I can't access the database with the MS Access application and I want to write a web query in asp to list the tables in the database. For example, I may not know what tables are in there and need to find out.

I know there is a way with mySQL using the "show tables" command but it doen't appear to work with Access

I also came accross some code with OpenSchema(adSchemaTables) that is suppose to do the trick, but it either doesn't work or my shared-hosting provider doen't have it set up to work.

If anyone could PLEASE help me out with the T-SQL query code to get table info I would be greatly thankful!

Thanks in advance,
Dan
dan@innovativead.com

View Replies


ADVERTISEMENT

Transfering Information From Query To Table

Mar 15, 2006

Hi there, this is probably a very simple problem for people with experience of Access, however i have been having problems with being able to tranfer information from a query to a table.

I have made a query which displays a number of different items with their prices and who bought them (ie. booking ID)

I have then made a query which asks for the booking ID, then once you have input that it searches the items and adds up the price for all the items which that booking ID has.

both these queries work fine. The problem i am having is that i want to transfer this total price into a table. I have been able to do this by manually typing into the sql code the price, however when i try to get the query to collect the price itselfs, it gives the error
"operation must use an updateable query"

btw i am making the query as a update query,

sorry if this post is a tad long and messy,
thx in advance for any help

View 1 Replies View Related

Using Append Query - Update A Table By Replacing All Existing Information

Dec 6, 2013

Can I use the append query to update a table by replacing all existing information with updated information while at the same time adding all data that isn't currently in the table?

Right now every time I run the Append Query it just adds the same information as a new row instead of replacing the existing row with the updated information.

View 8 Replies View Related

Queries :: IIF Statement Query - Pull Information From A Table Based On Specified Weight

Aug 4, 2015

I am having a problem to get my query to run properly. I have a huge IIf statement that doesn't seem to be working but I am not sure what is wrong with it. What it is supposed to do is return a good, actionable, or poor based on a specified weight and an actual weight. So what the query does is pull information from a table based on the specified weight and then using that information it should give back the correct rating in the last column.

Here are the conditions:

Poor:
AW(Actionable Weight)<Lower Actionable Weight
AW> Upper Actionable Weight

Actionable:
Lower Actionable<AW<Lower Acceptable
Upper Acceptable<AW< Upper Actionable

Good:
Lower Acceptable<AW<Upper Acceptable

The lower acceptable, actionable, and upper acceptable, actionable are different numbers based on the specified weight entered.

Here is the IIf Statement I currently have and I wasnt sure if order mattered or what I was doing wrong..

Rating: IIf([LOWER ACTOINABLE]<[Actual Weight]<[LOWER ACCEPTABLE],"Actionable",(IIf([LOWER ACCEPTABLE]<[Actual Weight]<[UPPER ACCEPTABLE],"Good",(IIf([UPPER ACCEPTABLE]<[Actual Weight]<[UPPER ACTIONABLE],"Actionable","Poor")))))

View 6 Replies View Related

DLookup Function To Load Information From Table To Another Table Using Subform

Mar 22, 2013

I have 3 table table; Invoice table, Product table and Sale_product table. Sale product table records all sale from the product table

Invoice table has these fields
ID
TOTAL
CASH_TENDERED
CHANGE

Product table has

ID
CODE
QUANTITY
NAME
PRICE

and Sale_Product table has these
ID
PRODUCT_CODE
QUANTITY
PRODUCT_NAME
PRICE
SUBTOTAL
INVOICE

I did main form from Invoice table and sub form from Sale_product table. I want to use DLOOKUP function to load the name and price, quantity and calculate subtotal automatically from the product table based on the product code entered. i have being trying hard and i keep on getting "Name? error"

View 1 Replies View Related

Information Within A Table

Apr 14, 2005

i am trying to create a form with a sub-form in it. i have got my client details in it - address, phone, etc then within that table i would like to keep a track of treatments for each time they visit in decending order. can anyone help me out with this? hope someone understands what i mean

View 3 Replies View Related

Looking Up Specific Information From One Table To Another

Aug 3, 2005

Hey everyone,

Ive got a bit of a problem with my database at the moment. Here are the two tables im specificly having problems with:

Item Stock

Item size
Serial Number
Delivery Date
Date out
Stock level

Item Fitted

Item Size
Date fitted
Reg number
Date Removed
Serial Number
Position

Here I have Item stock as my base table. Item Size and Serial Number info is collected from the base table and put into a combo box.

What im trying to do is when a specific item has been fitted, for access to note the size, serial number and date fitted, and place it into the correct record in the base table. serial number and size to be put in its respective table, and date fitted to be put in the "date out" field.

This is rather annoying i know and a bit difficult to explain, if anyone could help over msn that would be great - david_4321@hotmail.com

Thanks

David

View 1 Replies View Related

Need Default Information From Another Table

Feb 7, 2007

Hello, I have been looking around trying to gather as much access info as I can. I could really use some help with what seems like it should be pretty basic to me. I am making database for excavation estimation and have a table with my equipment and a field for default costs. I then have a table where I assign costs to a specific job. So I would choose a piece of equipment from the equipment table and then would like the default values entered in from the equipment table into the job table for the default costs. So a default value is put there that can be edited for the specific job. I am guessing I need to enter something into the default data area on either the table or on a field on a form? Can anyone give me the format for putting this in. The primary key in the equipment table (auto-number) is linked to a foreign key in the job table. Thanks in advance.

View 1 Replies View Related

Problem With Getting Information From A Table

Feb 14, 2007

Im using Access 2003.


I have a form with a combo box that has a list of all the names that are contained in a table.

I am trying allow the user to select a name but then when the user selects that name it pops up the email in another text box. The name that is being selected is in the same record that the email is in.

whats the easiest way to do this? vba?

View 1 Replies View Related

Sub Cell Information In A Table

Aug 9, 2005

I am not sure if this has been done in a table before. I have seen it in forms but not in tables.

Here is my problem.
I have created a database for a planespotters club. This database has the tables.
ac_logged
ac_maker
ac_model
country
airport

I am trying to display selected information in the ac_logged tbl that is related to other cells. For example: If someone selects boeing in the maker field they will only boeing models in the model field. Also, if someone enters Ireland in the country field only the airports for that country would be listed.

I don’t want to do this in a form but I could settle for a query if I have to.

I was just wondering if this could be done in a table as opposed to any other way.

Hope I have made myself clear on this one. :confused:

View 6 Replies View Related

How To Call Information From One Table In Two Spots

Jun 19, 2006

Please help!!

I am creating a program that will allow the user to select a sale and pull up only those product items associated to that sale in the details. Any help would be appreciated. Then with in the details section the user will/should be able to enter in the Quantity needed to order. Any suggestions on how to do this. My tblSale does provide the data needed so how do I get the data to go to the form?

I am new to this forum so if I have not asked properly I apologise now.

The Database is attached. Form Orders is the form that I am using to accomplish my task. The getproducts4Sale Query is the information needed.

View 1 Replies View Related

Adding Information To A Read-only Table?

Jan 31, 2008

Hello,

I wasn't sure which area to post this question in...since it involves queries, tables, and forms :)

There is a read-only table in my company's data warehouse that stores a lot of records. I wish to set up a form that will allow users to add or relate data (fields) to each of those records.

Updating the data warehouse table structure is not an option.

How can I best do this...

1. set up my own table somewhere, that will automatically append any new data warehouse records every night, so basically I'll always have a copy of the DW table, but with additional fields that can be updated?

2. set up another table/query that are linked to the DW table via unique identifier...but if I do this, how do I display the DW records alongside the new fields in a way that makes sense? another query? will I be able to write in data in this fashion?

3. ...some other way?

Any assistance will be very much appreciated!

View 2 Replies View Related

Table Structure - Transfering Information

Sep 25, 2006

I am creating a database for a hyperthetical car hire company. I have a table for the customer details, a table for car details, a mid table with current car hire information. I want to create a table for previous car hire information. Is there a way that i can transfer the details from the current car hire table to the previous car hire table without copying and pasting? (when the customer returns their car)

View 1 Replies View Related

Forms :: Look Up Information In Backend Table?

Aug 2, 2013

Is there a way to set up a keyword search within a form and use it to look up information in a backend table?

View 3 Replies View Related

Tables :: Pull Information From One Table To Another

Nov 19, 2012

I am brand new to building a database.What I want is a database to store Quote, Job and Invoicing information. We receive quotes first and then they can, but don't always, turn into jobs. We can also receive a job without quoting it. We currently have two spreadsheets. One is for Quotes and the other is for Jobs.

QUOTES INFORMATION
Quote #
Date
Customer Name
Part #
Part Name
Quote Due Date
Qty
Lead Time
Price
Unit

JOBS INFORMATION
Job #
Qty
Quote #
Customer Name
PO#
Part #
Part Name
Est Hours
Start Date
Due Date
Price

As you can see a lot of the information in the Quote spreadsheet is also used in the Job spreadsheet. (Bold represents duplicated items) We currently type the information into each spreadsheet.

Then there are different forms that are filled out for quotes and jobs that contain the information in the spreadsheets.Is there a way that I can have the QUOTE Table automatically populate the JOB Table information?

View 6 Replies View Related

Reports :: Table Information On A Report

Oct 10, 2014

I am trying to get some totals on a report, but the totals are from a table that the form is not related to as such.I am trying to get a textbox to show how many records in a query match the given criteria and show me the number of records that match. I was thinking DCount, but not sure if it will work?

I have a query called 'VehiclesAllocatedToday' which is already filtering records to show only those allocated today. On a report that shows Unfit Vehicle (and is related to a different query), I would like a text box that shows me how many records there are where the text "Type One" is in the TypeRequired field.

View 8 Replies View Related

Track Changes Of Raw Table Data Information?

Dec 19, 2012

Im working in MS Access 2003.Im creating an audit trail for users actions in a form, to monitor and keep track of what fields were updated/entered/removed from the database, these actions are essentially done from command buttons (and the audit trail, is coded on the button click)

However, I have a few search screens, that return a subform listing results. These datasheets returned are effectivly like opening the raw table and hence are editable, (permission to change is granted as they are admin only searches, yes, they can change the raw table)

How can I track the change to a raw table field, ie, if someone updates the field SURNAME from 'Smth' to 'Smith', is there something that triggers this (obviously if it was in an interface textbox, you could audit this) is their a field change. The only way i can suggest it make a recordset of the intial results, then compare that to the results in the table as they leve and compare the two.

View 7 Replies View Related

Using The Information Inputted In A Table As A Table Name

Apr 16, 2008

Hi,

I was wondering if anyone could tell me the correct syntax, or even if its possible to do the following, please remember that this code wil be written within the VB code... not in a query...

sqlstring = " "
sqlstring = sqlstring & " INSERT INTO markup SELECT TOP 1 Customername AS [Cust_Name],"
sqlstring = sqlstring & " customers.address AS [Cust_Address],"
sqlstring = sqlstring & " customers.postcode AS [Cust_Postcode],"
sqlstring = sqlstring & " customers.active AS [Active_Customer],"
sqlstring = sqlstring & " iif(Active_Customer =1, 'activecustomer','inactivecustomer) AS [Cust_Current],"
sqlstring = sqlstring & " FROM customers"
sqlstring = sqlstring & " WHERE customer.address = " & "'" & Inputaddress & "'"
sqlstring = sqlstring & " AND Cust_Current.address = " & "'" & Inputaddress & "'"
sqlstring = sqlstring & ";"

Therefore, using the value of what "Cust_Current" is as the table name in the where clause. So the where clause for the above statement would either be processed as ;

sqlstring = sqlstring & " AND activecustomer.address = " & "'" & Inputaddress & "'"
or
sqlstring = sqlstring & " AND inactivecustomer.address = " & "'" & Inputaddress & "'"

Depending on what the value of Active_Customer is.

Can anyone help?

View 14 Replies View Related

Popluating Table With Information From Another Table

Nov 11, 2005

I have an order entry screen which populates a table(TBLOrders). I also have a inventory Table(TblInventory). What I need to do is be able to enter the inventory item id on the form and then populate 4 fields in the TblOrders table with information which is stored in the TblInventory.

I have tried Auto Lookup it brings the information on the form but it doesn't save it to the table. Is the form source suppose to be the Auto Lookup Query or the TBLOrders? I am missing something but not sure what. Any suggestions would be appreciated.

View 1 Replies View Related

Making A Form To Call Up Information From A Table?

Jan 27, 2005

I'm making a customer survey database. Also be aware I'm not proficient with access.

All the customer information is being imported from an excel spreadsheet. That will include ServiceRecordID, ServiceDate, TechID, CustName, ServLocation, PhoneNum, and DeptID.

Another table will include records for answers to 5 questions that will be asked by a manager on the phone. That table is called TblQuestions. This table will also have ServiceRecordID to go with the answers.

What I'm trying to do is create a Form that at the top has a box for ServiceRecordID. I'd like to be able to type in the Number for that ID, and then all the information shows up on the form for that specific ID. And below all that, fields to add the answers to TblQuestions for that specific ServiceRecordID.

The reason I'm doing this is because the manager will get a report with the customer information that needs a follow up call. So I want them to be able to call up that information on the screen with the ServiceRecordID number, and also be able to add in the information that they get back from the customer with the questions that will be asked.

I don't know why I'm having so much trouble with this. But I'm not experienced with access or VBA both.

View 2 Replies View Related

Using Form Fields To Display Other Table Information

Jan 17, 2006

Hi, I was wondering if anyone could help me.

I have a simple database, consisting of two tables and one form. I'd like the form to display information mainly from the first table (table 1). For this, I have used the Form Wizard, which works well and displays as it should. My problem comes when trying to display data from table 2, without using the Form Wizard.

I have a simple field called 'Number' in 'Table 2'. I'd like this value displayed in a text box along with table 1's data. I've tried using the expression builder, which gives me something along the lines of:

[tbl_Table 2]![Number]

But this is displayed as:

#NAME

...when I open the form. Could anyone explain how I do this correctly please? All I'm trying to do is display data from other tables in the form.

Any help is much appreciated.

View 5 Replies View Related

Log-in User Information Text Box Is Not Passing Into Table

Mar 21, 2006

Hello experts

good morning. here comes my doubt. i use =CurrentUser() in text box of form. but when am testing, the user name is not there in database.

i am using Access 2003 and Access security.

Can anyone tell how to resolve this

Thanks you:)

View 1 Replies View Related

Accessing Information From A Table Record Using Codes....

Jun 19, 2006

Hi all,

I've got this simple thing.. which I couldn't do and stuck for a long long time.. I have done some programming in a few languages, but not in SQL or VBA and I quite confused about programming styles that VBA and SQL accepts.

I'm currently working in Microsoft access and the thing I'm stuck on is retriving field value from a record and writing into another record on the same table.

For example the table "Table-users" looks like the following:

ID Name Year Month Date
1 Steven 1979 9 18
2 Jeremy 1977 10 22
3 Eslynn 1988 10 10

I've built a form that contains two lables (combobox), "ReplaceMe" "LoadMe" and a command button. Which end user could choose which record to load and which to replace.

I wish to copy Year, Month and Date from LoadMe into ReplaceMe without effecting the Replace me ID and Name.

The VBA, SQL code i've got looks like.
-----------------
'Command_Click is the tigger button to active the following code.
Private Sub Command37_Click()

'Below is an example of what I wanted to do field by field. However, in the real
'environment, I needed to move about 20 odd field into another object. I'm not sure
'to use Append or Update Query
Dim UpdateSQL As String
Dim text1 As String
Dim text2 As String
Dim text3 As String

'this loads the string containt-the Name of the object-into text1.
'this line works fine, arr.. other ones don't.......
text1 = Me!ReplaceMe
text2 = Me!LoadMe
'Load the month of the LoadMe.
text3 = Table![Table-users = text2].month

'Loads the SQL instruction into UpdateSQL
'Table-table is a table, containing several objects and fields.
UpdateSQL = "INSERT INTO [Table-users].text1( [Day], [year], [month] ) " & _
"SELECT Table-users.Day, Table-users.year, Table-users.month" & _
"FROM Table-users" & _
"WHERE (((Table-users.Name)='ReplaceMe'));"

DoCmd.RunSQL UpdateSQL

End Sub--------------------
Well the obvious, the above code doesn't run.
If LoadMe = Jeremy, ReplaceMe = Steven, the above code should return:

ID Name Year Month Date
1 Steven 1977 10 22
2 Jeremy 1977 10 22

Making Steve's Year, Month and Date field the same as jeremy

======================

What I think i'm confused about is when do I use [ ] ( ) ! .

Like... if I wanted to read the field value of "Date" from the object from the "Name" in combo box "LoadMe", what should I write?

ie, if the combo box "LoadMe" contains Eslynn. The end result should be 22.

Many thanks

View 2 Replies View Related

General :: Saving Information From Form To A Different Table?

Nov 26, 2012

I have created a form and a subform within it, I have managed to populate all the dropdown boxes from the tables I need. but I need to save all the information in putted to a table called bookingstbl and I do not know where to begin?

View 6 Replies View Related

Tables :: Autofill Information In Invoice Table

Feb 11, 2015

I essentially created an account since I can't seem to find a straightforward answer much anywhere else (plenty of hints on auto-filling forms- but that isn't particularly conducive to my specific need on this).

I've attached a blank copy of my database.

The immediate concern I'm having is that I want to be able to autofill data in the invoice table based on the customer table and the products/service table.

*I want to be able to select a first name [or other primary key if necessary] to fill in the last name, company, address, city/state/zip, phone, fax, cell/alt phone, and email automatically... that is without multiple dropdown selections or input to those sections at all.

*I want prices to fill in to the 'cost of product/service X' so that I may use it for other calculations in the invoice table- as well as to make forms from it directly.

View 7 Replies View Related

Tables :: Information Populating In Another Table Form?

Jun 9, 2014

I have created two tables. One table list of 100 Categories that I monitor each month. The Categories are never changing month-to month, however, each might be associated with a different client month-to-month. Presently, I am manually typing in the Client information month-to-month with information pulled from the Client's table. The Client's table has a Category Field which is populated when a Client has purchased space to use it.

In essence, I have the Category Table (Fields: Record Number; CategoryName; Client Name; beginning date the client will use the Category and Ending Date the client will stop using it). The Client's Table has a lot more fields/information but it still has the same fields as the Category Table. I am trying to be able to use the Category Table and have it automatically populate with the client who is using the Category at that time. Any Category not being used by a Client then the Query should write "Open" in the Client's name field. I have tried many different scenarios but can't seem to get it to work. I must see all 100 Categories each time I run a report. It doesn't have to say "Open" but where ever a client did not use the Category it should be left blank.

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved