I want to past the variable strSQL into the ASP script. The strSQL variable is a VBScript variable.\n\nstrSQL = "SELECT * FROM tbl_Hardware WHERE Hardware_ID = 2" \n\n<%\nSet rs = cnnLogin.Execute(strSQL)\n%>
213462
I am assuming that the code - \nstrSQL = "SELECT * FROM tbl_Hardware WHERE Hardware_ID = 2" \n\nis in a <script language=vbscript> block....\n\nIf I am correct, then that part of the code will be available on the client side, whereas the code that you have in the <%%> block is a sever side code available on the server side.\n\nIf the value of strSql does not change on the client side then one way of doing this is\n\n<%\ndim sql\nsql = "SELECT * FROM tbl_Hardware WHERE Hardware_ID = 2" \n%>\n<script language=vbscript>\nstrSQL = <%=sql%>\n </script>\n<%\nSet rs = cnnLogin.Execute(sql)\n%>\n\nIf the Value of the strSQL changes on the client side, then you need to pass it back to the server on submit using some sort of hidden fields.\n\n-jainnys\nMind Experts Inc\nhttp://www.mindexp.com
375940
I'm not sure what the wildcard character is in foxpro.\nBut, if it uses standard sql, you'd build something like this in vb.\n\ndim sql as string\nsql="select * from <tablename> where <fieldname> like"\n\nsql=sql & " '%'" & textbox1.text & "'%'"\n\nusing your example, the sql would be\n\nselect * from example where examplefield like '%an%'\n\nThe wildcard character (%) might be different  -\nsometimes, I've seen it as (*).\n\nBut, that's the gist of it.
302079
You do that with a dialog box:\n\nhttp://www.c-sharpcorner.com/Code/2002/Aug/PassingDataInForms.asp
613564
Please note for any of this to work you have to have the project references include the Microsoft ActiveX Data Objects library\n\ndim conn as new ADODB.Connection\ndim rs as new ADODB.Recordset\n\n'Tell your connection what and how to connect\nconn.ConnectionString= "DSN=DSNname;UID=SqlServerUserID;pwd=SqlServerPassword"\n\n'open the connection\nconn.open\n\n'Run your SQL Query\nset rs = conn.Execute("Select * from datatable")\n\n'See if any records were returned we do this\n'by seeing if the recordset is simoultaneously reporting\n'that it is at the beginning and end of the record set\nif not rs.EOF and not rs.BOF then\n\n\n     'Get the field by field name\n      myValue=rs("fieldName")\n\n     'Get the field by position in the return set\n     'This is a zero baed index\n      mySecondValue= rs(3)\n\n     'Now I move to the next record. \n     rs.MoveNext\n\n     if not rs.EOF then\n          'Get another value\n           myValue=rs("FieldName")\n     end if\n\nend if\n\n'now close and clean up\n\nconn.Close\nset rs = nothing\nset conn=nothing
23675
First of all, is it a browser based or a windows program? There are many different ways to do it with many different languages. \n\nIf it's browser based, you can create such program using JavaScript or any other Server-side scripting program. \n\nGive us more detail and we will let you know which language you can use.\n\nAdded on 01/20:\nOk, it might be a little late to answer this question, but you can do it by using JavaScript. If you don't know JS, then you can't do it in one night from scratch. \n\nGo buy a book and learn JS. Maybe it will help you next time. \n\nPS: Did you win?
228020
Sounds like a custom script you'd have to create in VBScript.
348543
That is javascript... html does not have variables!\n\nyou could do it without a <script> tag... is that what you meant?
23459
ASP uses VBScript as a difault scripting language. According to VBScript the syntax of If.. Elsif is as shown in the bellow example. Follow this.\n\nif payment="Cash" then\n   msgbox "You are going to pay cash!"\n elseif payment="Visa" then\n   msgbox "You are going to pay with visa."\n elseif payment="AmEx" then\n   msgbox "You are going to pay with American Express."\n else\n   msgbox "Unknown method of payment."\nend If\n\n\nRaghava\nProgrammer Trainee
387572
i think its variable1 = (object name).text.value\nor variable1 = (object name).value, something like that, i nt very good though
441113
This doesn't use your variables etc.  But....It is javascript code that I have used that works......You can compare and modify....\n\nHere is the form:\n\n<form name="x" id="x">\n                      <tr> \n                        <td >User ID:</td>\n                        <td> <input name="id" type="text" id="id">\n                        </td>\n                      </tr>\n                      <tr> \n                <td>Password:</td>\n                        <td> <input name="pass" type="password" id="pass"> \n                        </td>\n                      </tr>\n                      <tr> \n                        <td > \n                      <tr> \n                        <td >\n                          <input type="button" value="Log In" onClick="checkLogin(this.form)">\n                        </td>\n                      </tr>\n                    </form>\n\n\nIn the head tag I reference the external javascript file......\n\n\njavascript file:  I will use your variables....\n\n\n\nfunction checkLogin(x)\n{\nif ((x.id.value != "default") || (x.pass.value !="admin"))\n{\nalert("Invalid Login! Please make sure caps lock is not on and try again.");\nreturn false;\n}\nelse\nlocation = "zipper.php";\n}
33588
U must have given the name of the variable in the "  ".\nGive it outside double quotes.
117443
Here's a code snippet that you should be able to paste into a form module and give it a try ... there are obviously many ways to tackle the issue ... this is just one of them.  To use this code you'll need a reference in your VB6 project to a Microsoft ActiveX Data Access Library (like 2.6).  Good luck!\n\nDim rs As Recordset\nDim cn As Connection\n\nDim DBPath As String\nDBPath = App.Path & "&#92;customer.mdb"\nSet cn = New Connection\ncn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & DBPath\n\nSet rs = New Recordset\nrs.CursorLocation = adUseClient\nrs.Open "SELECT * FROM tblCustomers WHERE CustomerID=" & 1, _\n    cn, adOpenStatic, adLockOptimistic
219572
use something like this:\n\n'PLSQL block starts here\nPLSQL Statement 1\nPLSQL Statement 2\ntry\n   PLSQL Statement 3\n   PLSQL Statement 4\ncatch exception\n   'do exception handling\nPLSQL Statement 5\n'PLSQL block ends here\n\nThis could be your structure.. here you are using Try catch block with in the PLSQL block. Statements that throw the exception; put them in try catch block and rest out of it. So any exception is thrown it will be caught by the catch exception and processed. Once you are out of the catch you execute rest of the statements of the PLSQL block and loop back.
394419
For Some reason, it will not display the code correctly. Email me and I will send it to you, unless this is enough.\n\nOK, did this once before, then I abandoned it for PHP and MySQL.  Here was my code:\n\ndim objConn\nSet objConn = \nServer.CreateObject("ADODB.Connection")\nobjConn.ConnectionString="Driver={Microsoft Access Driver (*.mdb)};" & _\n"DBQ=MyDatabase.mdb"\n\ndim objRS\nSet objRS = Server.CreateObject ("ADODB.Recordset")\nobjRS.Open "MyTable", objConn, , , adCmdTable\n\n// Replace "MyDatabase.mdb" and "MyTable" with the Access Database name and the Table name.\n\nthe line that has ADODB Conn... should say \n("ADODB.Connection")\n\nHope this helps.
59396
Dont declare @i as int, but as varchar(20) and assign it like this\n\nSET @i = '1'
155200
VBScript uses the quotation mark as an escape character.\n\nEssentially, use two quotation marks ("") within a string to represent a single quotation mark.\n\nExample: Quoting nicknames\n\nWscript.Echo "Bret ""Hitman"" Hart" 'Using double quotes
388969
If by passing variables you mean passing them and not using them? please clarify your question...but if so\n\nThere are two general ways to pass a variable...\n\nIn Visual Basic speak they are By Value and By Reference\nIn C speak there is passing a variable and passing a pointer to a variable\n\nUsing VB:By Value or C: Passing:\n+/-) The function will not be able to edit the variable you give it\n-) A copy of the variable must be created this takes more ram and calls to allocate the space etc... slower but not really noticeable\n\nUsing VB:By Reference or C: Pointers:\n+/-) The function can edit the variable you pass\n+) No copy is made and the memory address of your variable is passed to the function\n\nWhen you pass 'By Value' you are giving the function a copy of the variable so if have the following VB code:\n\n...\n    sName = "Bob"\n    bResult = CheckMyName(sName)\n    MsgBox sName\n....\nPublic Function CheckMyName(ByVal sPName) As Boolean\n    sPName = "David"\nEnd Function\n\nNow yes im using plain old VB code here... but your question wasn't exactly full of information to help with answering it :)\n\nThat code will simply show a message box with "Bob" as it passes the sName variable by value so it makes a copy... now if change the function just a little...\n\n...\n    sName = "Bob"\n    bResult = CheckMyName(sName)\n    MsgBox sName\n....\nPublic Function CheckMyName(ByRef sPName) As Boolean\n    sPName = "David"\nEnd Function\n\nThis code will show a messagebox of "David" as we passed the variable by reference\n\nhope you get what i mean... if not, ask and i can clarify