Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. apex82

    Retrieve Identity Column Value After Inserting Record

    Sorry. Please ignore this. It is working perfect!
  2. apex82

    Retrieve Identity Column Value After Inserting Record

    I didn't test this completely. It works perfect when adding only one record. When I try to add more than one it gives the error below: Can I change the procedure to accomodate adding more than one? Thanks.
  3. apex82

    Delete record from another table

    I only delete one record at a time so should that be okay. I will research on "Foreign Key Constraints" and "Cascade Delete". Thanks again.
  4. apex82

    Delete record from another table

    Thanks very much. I'll try that. I appear to have it now working using the following but I try your suggestion too: Thanks again! CREATE TRIGGER [dbo].[Delete_Logo] ON [dbo].[Business] AFTER DELETE AS BEGIN DECLARE @LogoID int SELECT @LogoID = LogoID FROM deleted DELETE FROM...
  5. apex82

    Delete record from another table

    In the post above On [Company_Logos].Logo_ID = deleted.LogoID Should have been On [Business_Logos].Logo_ID = deleted.LogoID
  6. apex82

    Delete record from another table

    Thanks, I added the code and it gave an error: On this line I changed from: On [Company_Logos].Logo_ID = deleted.LogoID To: On [Business_Logos].Logo_ID = Business.LogoID The trigger then worked but it deletes everything from [Business_Logos] apart from the record I want it to. Do I...
  7. apex82

    Delete record from another table

    Thanks chaps. If I add the following code the correct record from the [business] table is deleted however, it deletes everything other than the correct record from the [business_logos] table. sql = "DELETE FROM Business" & _ "sql = sql & " WHERE [Business_ID]='" & str_delete & "'" & _...
  8. apex82

    Delete record from another table

    I use the following SQL statement coded in ASP to delete a record from a SQL server database: It deletes the record based on a dropdown menu which send the Business_ID. SQL = "DELETE FROM Business" SQL = SQL & " WHERE [Business_ID]='" & str_delete & "'" I also want to delete an image that...
  9. apex82

    Retrieve Identity Column Value After Inserting Record

    Works perfect! Massive thanks George!
  10. apex82

    Retrieve Identity Column Value After Inserting Record

    I have the following code, which inserts into a database a record with a primary key named System_ID. For i = 0 to Ubound(val) if len(val(i))=2 then str_SQL = "INSERT INTO System ([BusinessID], [System Code], [System Description])" str_SQL = str_SQL & " VALUES " str_SQL = str_SQL & "('" &...
  11. apex82

    Error when using an apostrophe in text box

    Thanks, the original post by foxbox worked for me but only if the field already contained a value. Otherwise it produced an error. Foxbox where do you call the function FQ? Thanks.
  12. apex82

    Error when using an apostrophe in text box

    I have a text box on my page that calls a record field from an SQL database like so: <textarea name="EditText" cols="60" rows="5" id="EditText"><% Response.Write obj_RS1("Notes") %></textarea> The field Notes data type is varchar(8000) When I add an ' (apostrophe) into the text box and...
  13. apex82

    Replace function

    Thank you Feherke! Really appreciate it. Works perfect. I need to swot up on regular expressions!
  14. apex82

    Replace function

    Each of the “three values” can change so AA – Test – AA might be something like BB – test1 - CC So in the two examples I above I basically want to be left with Test or test1 The following code replaces the “first value” replace(/\w+[- ]+/,''); so I’m left with Test – AA I want to replace...
  15. apex82

    Replace function

    I have the following function that replaces part of a string so that the following: AA – Test – AA Becomes: Test – AA function Add () { var selObj = document.getElementById('Test1'); var txtObj = document.getElementById('Test2'); var selIndex = selObj.selectedIndex...
  16. apex82

    Only allow certain access via IP address

    This does actually work! I had the include file link in the incorrect place. Doh..
  17. apex82

    Only allow certain access via IP address

    I have the following code that I am using to try to only allow access to a page to users with a certain IP address. [code] <% Select Case Request.ServerVariables("remote_addr") Case "ip address" Case Else Response.Redirect "http://www.google.co.uk/" Response.End End Select %> This doesn't...
  18. apex82

    Inserting more than one record from form

    Thanks foxbox. This is it: input = split(Request.Form("SystemCode")," ") For i = 0 to Ubound(input) Response.Write "Inputs are -"& input(i) Next For i = 0 to Ubound(input) Response.Write "Inputs are -"& input(i) sSQL = "INSERT INTO System ([BusinessID], [System Code], [System...
  19. apex82

    Inserting more than one record from form

    I would want to be able to add these values into the input box so I would be typing more than one "two digit code" to the input box. e.g. AA BB CC. Whilst only selecting one value from the dropdown.

Part and Inventory Search

Back
Top