enter parameter value

Results 1 to 2 of 2

Thread: enter parameter value

  1. #1
    Join Date
    Dec 1969

    Default enter parameter value

    Function GetComputerName()<BR><BR> Dim strUser As Object<BR><BR> Set strUser = CreateObject("WSCRIPT.Network")<BR><BR> GetComputerName = Trim(strUser.ComputerName)<BR><BR> strTableNames = GetComputerName<BR> strTableName = "MainT"<BR> strSQL = "UPDATE " & strTableName & " " & _<BR> "SET MainT.LoanNum = &#039;5&#039; " & _<BR> "WHERE MainT.Expr1001 = " & strTableNames & ";"<BR><BR>How come when I run this code I get "Enter Parameter Value"<BR>and lists the value, I type the exact same value and it works???

  2. #2
    Join Date
    Dec 1969

    Default You *really* have a DB field...

    ...named "Expr1001"????<BR><BR>That sure looks like a field that is the result of a query, to me!<BR><BR>Anyway, the code doesn&#039;t make much sense.<BR><BR>If strTableName is anything *except* "MainT", then the query is junk.<BR><BR>You&#039;d end up doing something like<BR> UPDATE foo SET MainT.LoanNum = &#039;5&#039; WHERE MainT.Expr1001 = Aardvark<BR><BR>And just incidentally, you seem to have the idea of apostrophes completely backwards.<BR><BR>Numbers--constant numbers--do *NOT* get &#039;...&#039; around them. <BR>Text values--constant strings--*DO* get &#039;...&#039; around them.<BR><BR>Finally, the fact that you are possibly changing the table name in the UPDATE indicates to me that you probably have a bad DB design. Why would you have multiple tables with the same fields but with different names? Better DB design would be a *single* table with some field that differentiates the logical subtables.<BR><BR>But first things first, explain why you have a field in your table that is named EXPR1001.<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts