Dynamic Variables Syntax
What's the correct syntax here:
(given the recordset myRS with x records
do until myRS.EOF
txtvar & myRS("serial_number") = myRS("serial_name")
myRS.movenext
loop
..asp will not build the dynamic variables
txtvar1 = "Some name"
txtvar2 = "Any name"
txtvar3 = "Your name"
.....
Based on the serial_number in the current recordset.How can I builde the dynamic variables, and give them a value from my recordset?
View Replies
ADVERTISEMENT
I'm having a problem with passing variables inserting to my database. Here's what I'm doing. I have a page where the user selects a team member (this is fine) Once the team member is selected I have the variables on the form send and email to all supervisors and the member selected (this is fine also) BUT, I'm having problems inserting the emailed information to my access 2000 database after is email. Can someone guide me in the right direction.
View Replies
View Related
Is there a way to create dynamic variables when looping through a recordset? For example below, after the 1st loop I'd have myVarA1 and myVarB1, after 2nd loop, I'd get myVarA2 and myVarB2.
CODE ***********************************
set objRS = GetMyRecordSet()
i=1
objRS.MoveFirst
Do While Not objRS.EOF
"myVarA" & i = objRS(0)
"myVarB" & i = objRS(1)
i = i + 1
objRS.MoveNext()
Loop
View Replies
View Related
I'd like to create a series of variables created dynamically, example such
as this...
For i = 1 to 5
TheVariable & i = "blah"
Next
This would during the first loop create a variable called 'TheVariable1'
with a value of 'blah'. Is this possible as so far I'm getting syntax
errors?
View Replies
View Related
I have a spare parts database that I am working on. All that needs to be stored is the part description, what it goes to, and the quantity in stock.
Since that's all that I need, I want to be able to allow the user to edit the quantity right on the results page, through a textbox. Just change the number in the textbox for each part, press the button, and voila, it's all saved to the database (and is redisplayed for your convenience.)
However, there is no set amount of part rows. Right now, I'm creating the text boxes using the id of the item (i.e., name="quantity<%=RS("partID")%>"), but I'm not certain how to call the variables to put in an insert.
What is the syntax for dynamic/variable variables (if they even exist in ASP)?
View Replies
View Related
i have a website that uses (or needs to use) dynamically driven dropdowns using asp & JS on all pages. it contains 3 different dropdowns that are DB fed and are dependent upon the value of each other. the drop down values are updated using a repost to itself.
they work perfectly on the initial pages where no other variables are involved, but i am having troubles on the pages where more variables are being sent. eg: i have use a lot of error checking, and when i repost, the variables are deleted, and thus the error listings take effect as the variables are now blank. can i refresh the dropdowns without repossting to the samepage without effecting the existing variables on that page? sessions? cookies?
View Replies
View Related
I code that creates a calendar for each month and then it displays events from that month that are stored in a db. I need to loop through my recordset and display all the events, but I can't quite figure out how to do it. I am thinking I need to do an array. But I am not really sure.... any ideas. Here is where you can view the calendar. Code:
View Replies
View Related
can anyone tell me difference between environment variables and server variables.
View Replies
View Related
Ok, I have a Javascript ASP and in it I have a dynamic repeating table with certain attributes to people. If one of these attributes is old or invalid, i want to change the color of the text (and maybe make it flash, blink, change size, something) so that it's easy to read.
View Replies
View Related
I'm not sure how to best describe my problem, so a simple example should help explain things:
I have two arrays, called set1_data and set2_data
if I create a variable like so:
firstPart = "set1"
and then assign like this:
copyOfArray = firstPart & "_data"
how do I make copyOfArray reference the set1_array, as opposed to just a string "set1_array" which is what it's doing?
I've had a good rummage round ye olde Internet but couldn't find anything there must be a keyword or function to achieve this?!?
View Replies
View Related
Can I use this syntax
Where NOT IN (".....)
in a situation I don't want to select items in the list.
If not what other ways can do that.
View Replies
View Related
I'm just trying to display a user's FIRST name and the FIRST INITIAL of the last name on my asp web page.
This works to displays their "firstName" and "lastName":
Code:
<%=oUsers("firstName")%> <%=oUsers("lastName")%>
But I get a variety of vbscript or asp syntax errors when I try to trim the "lastName" using something like
Code:
<%=oUsers("firstName")%> <%=oUsers(replace(left("lastName",1))%>
How do get this simple task done?
(If it makes any difference, the whole thing is inside html <td></td> tags as part of a table)
View Replies
View Related
I can't see to find where the syntax is wrong because I can do the query just fine in access but my asp page gets this error
Microsoft JET Database Engine error '80040e14'
Syntax error in INSERT INTO statement.
Here is what the insert looks like when I print it out in the page
INSERT INTO tblusers (username,password,[Timestamp],email) VALUES('testuser', 'c4ca4238a0b923820dcc509a6f75849b', '10/16/2004', 'me@home.com')
Here is the code:
View Replies
View Related
I am trying to query a database for 2 conditions but I can't get the query to work.
Can anybody see a problem with this line of code?Code:
strQuery="SELECT Count(*) AS intTotal FROM tbl_artists WHERE fld_artist_name = '" & strReqname & "'" "AND fld_user_id ='"& strUsername & "'",objConn,,,adCMDText
objRS.Open strQuery,objConn,,,adCMDText
numRecords = objRS("intTotal")
View Replies
View Related
I have a textarea and have named it category_One.
I have sent the data in this form on using the POST method
contents_category_One = Request.Form("category_One")
I have then used the following sql statement
sql = "INSERT INTO tableName(Category_One) VALUES ('"& contents_category_One &"');"
If someone inserts ' in the text box, this value is causing a syntax error in the sql statement.
View Replies
View Related
The WHERE part of my select needs to pull out where the date column is empty. If there isn't a date, it shows NULL in the database (SQL7)."WHERE eligibility_dt <> NULL" doesn't work. what am i forgetting?
View Replies
View Related
I need help with ASP. when i post data to the database, do the records in my form need to be in the same amount as the database records?
View Replies
View Related
Would anyone have some syntax for a query (SQL2000) that would return results for records that are over 24 hours old (date field is smallDateTime)?
View Replies
View Related
I believed that there is a wrong syntax on the window.open line...Can anyone spot it ?
Code:
strLocation = "Sch_As_FollowAct.asp?drvid=" & request("drv") & "&u=" & uday(0)
response.write "<script>" & vbCrLf
response.write "window.open('" & strLocation & "' & ",menubar=1,resizable=1,width=350,height=250");" & vbCrLf
response.write "</script>"
View Replies
View Related
i am having some trouble rembering the correct syntax for a If Then Statement here is my code.
<% If Request.QueryString("access") = "false" Then %>
<tr>
<td colspan="2" bgcolor="#FFFFFF" class="mediumRed">The User
ID and Password combination has failed.<br> <br>
Please try again.</td>
</tr>
<% Else If rsGettblCouples.Fields.Item("StopDate") = "1/1/1900" Then %>
<tr>
<td colspan="2" bgcolor="FFFFFF" class="mediumRed"> The User has already<br>
completed the online scoring.<br>Please Contact your facilitator.</td>
</tr>
<% End If %>
<% End If %>
View Replies
View Related
Can someone direct me a set of rules for building strings in ASP? I'm always getting stuck on when to use a quote (") or apostrophe{'} or both. This simple string is giving me fits...
Response.Redirect("test3.asp?orderno='" &
(rsProducts.Fields.Item("OrderNo").Value) & "')"
I can't seem to get the right combination.
View Replies
View Related
What's wrong with the syntax in this connection string? It's a DSN less connection to an Access DB.
<%
Set Conn = Server.CreateObject("ADODB.Connection")
MM_GenKAccess_STRING = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & _
Server.MapPath("authors.mdb") & ";" & _
Jet OLEDB:Database Password=48912; & _
Jet OLEDB:System database=" & Server.MapPath("system.mdw") & ";" & _
conn.open MM_GenKAccess_STRING
%>
View Replies
View Related
I want to update multiple rows in an SQL table. Presently, it's populating all rows with the same data based on the first row. It's not looping through all records one at a time.
Is this the correct syntax.
<%
rsOD 'recordset up here
%>
<%
Dim DataConn1
Set DataConn1 = Server.CreateObject("ADODB.Connection")
DataConn1.Open MMSTRING
Do While Not rsOD.EOF
'SQL UPDATE statement here
DataConn1.Execute(SQL)
rsOD.MoveNext
Loop
%>
View Replies
View Related
Can any one tell me why this snippet is not showing the a href correctly. Sorry, not sure of ASP syntax as yet...
Response.Write Highlight(myTextwo, "", "", "<a href=""url.com=" & CInt(rsrch("tablcolumn")) & """ target=""_blank"">" & rsrch("othercolumn")) & "</a>"
View Replies
View Related
Another slight problem with syntax of asp, basically I'm pulling an image file name from my database (image1.jpg) and using the images directory on my web server to display my picture, make sense? Code:
View Replies
View Related
I believed that there is a wrong syntax on the window.open line. Can anyone spot it?
strLocation = "Sch_As_FollowAct.asp?drvid=" & request("drv") & "&u=" & uday(0)
response.write "<script>" & vbCrLf
response.write "window.open('" & strLocation & "' & ",menubar=1,resizable=1,width=350,height=250");" & vbCrLf
response.write "</script>"
View Replies
View Related
If you haven't noticed I am novice and have just started getting back into the world of ASP. First question can I have two And statements, and second the syntax is wrong with my And statements where can i find a reference to see the proper syntax. Code:
mySQL= "SELECT tbl_Sch.Schedule_id, tbl_Sch.TeamId, tbl_Sch.GameDate, tbl_Sch.GameDescription, tbl_Sch.GameTime, tbl_Sch.GameStatus, tbl_Sch.Season, tbl_team.TeamID, tbl_team.Team_Name, tbl_team.Enabled" _
& " FROM tbl_team, tbl_Sch " _
& " where tbl_team.TeamID = tbl_Sch.TeamId" _
& " And tbl_team.Enabled = '"-1"' " _
& " And tbl_Sch.Season = '"2005-FAL"' ;"
View Replies
View Related
I am trying to update my database with hidden fields that are being requested from a previous page such as:
hfSectionOneScore
hfSectionTwoScore
hfSectionThreeScore
I'm not familiar how to write an UPDATE statement, and would like some help. I'm thinking that it is something like this:
UPDATE Director_Appraisals SET
Section1Score = request("hfSectionOneScore"),
Section2Score = request("hfSectionTwoScore"),
Section3Score = request("hfSectionThreeScore"),
WHERE UserID = request("hfUserID");
Of course there are more columns, but am I on the right track? Does the syntax look correct?
View Replies
View Related
I am concatenating the firstname and lastname in the SQL query in the ASP page. I get the error:
Syntax error near =
This query works in Access.
<input type=hidden value="<%=strNetworkID%>" name=""networkid">
"SELECT" EmpID, FirstName + ' ' + LastName as Employee_Name, NetworkID FROM Employee WHERE networkID = " & Request.form("networkid")
View Replies
View Related
I just decided to leave Mssql and start using Mysql. I am having some problems with my queries; is there anyone here who has a knowledge of query syntax in Mysql?
View Replies
View Related
StrSql = "SELECT * FROM [" & Screen & "] WHERE (CPN="&(COORDID)&") AND (CNUM="&(CNUMQS)&")
View Replies
View Related
I'm using an Access database file for this. I can issue SELECT statements on the database, but for some reason it says I have a syntax error with my UPDATE statement.
Code:
openAccessRS("UPDATE students SET password='test' WHERE sid='123456789' AND email='google@yahoo.com'")
Don't worry about the openAccessRS function. It just takes the query and issues the ADO.RecordSet.Open function. I have the students table filled with the correct information. I do have an entry where the student id (sid) is 123456789 and email = google@yahoo.com.This query worked fine in a MySQL DB.
View Replies
View Related
Microsoft JET Database Engineerror '80040e07'Syntax error in date in query expression 'fldUserName= 'muratsa' AND fldTimeIn=#01.09.2003 16:52:20# AND fldOffline=0'. /Vestelweb/logout.asp, line 7
I am using the Now() function to get the date
in db the format is general date and in regional settings of the server the seperator is "."
View Replies
View Related