If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > Having a problem Inserting and relating to multiple tables.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-10-03, 11:01
Bigced_21 Bigced_21 is offline
Registered User
 
Join Date: Dec 2002
Location: KY
Posts: 54
Exclamation Having a problem Inserting and relating to multiple tables.

the main info is in HBC_zImport which was imported from access in raw form. I broke that tbl into 2 tbl's, 1 for Alpha and the other tbl for Numerical violations. these 2 tbl's had a field that is 3 characters long to combine into one to form a violation. which is already six characters long in the HBC_zImport tbl.

In the HBC_violation_boiler_Inspection_Link, the fields are alpha...ID, Num...ID and Boiler_Inspection_ID. I want to relate this current tbl with the data in HBC_zImport that has the raw data of violations. So, basically what i'm trying to do is relate the violations to the boiler_inspection_ID.
If you need more clarification please email me!!!!!!!!!

strSQL = "Select Violations from HBC_zImport"
set rs1 = objConn.Execute(strSQL)

strSQL = "Select * from HBC_Alpha_Violation_CodeDef"
set rs2 = objConn.Execute(strSQL)

strSQL = "Select * from HBC_Num_Violation_CodeDef"
set rs3 = objConn.Execute(strSQL)

strSQL = "Select * from HBC_Boiler_Inspection"
set rs4 = objCOnn.Execute(strSQL)

Do While NOT rs1.EOF
rs2.Movement()


Do While NOT rs2.EOF
rs3.Movement()

Do While NOT rs3.EOF
rs4.Movement()

Do While NOT rs4.EOF

strSQL = "Insert into HBC_Violation_Boiler_Inspection_Link (Alpha_Violation_CodeDef_ID, Num_Violation_CodeDef_ID, Boiler_Inspection_ID) "
strSQL = strSQL & VALUES ('" & replace(rs2("ID"), "'", "''") & "', '" & replace(rs3("ID"), "'", "''") & "', '"replace(rs4("ID"); "
Reply With Quote
  #2 (permalink)  
Old 02-12-03, 04:23
pal19 pal19 is offline
Registered User
 
Join Date: Feb 2003
Location: @ home
Posts: 163
Re: Having a problem Inserting and relating to multiple tables.

You get an error messange or you dont get all the values that you whant?

______________
Paulo Gonçalves
Reply With Quote
  #3 (permalink)  
Old 02-14-03, 17:32
kiranmath kiranmath is offline
Registered User
 
Join Date: Feb 2003
Posts: 6
Re: Having a problem Inserting and relating to multiple tables.

Remove the semi colon ( ; ) from the sql statement where U do the insert .

Hope that helps

Kiran Math
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On