Search:
Type: Posts; User: DataMiser
Search:
Search took 0.24 seconds.
-
July 12th, 2013, 02:43 AM
??
I do believe he is talking about threads on the message board rather than threading in his programs.
Yes much better to start a new thread for a new issue.
You should also mark your...
-
July 10th, 2013, 11:24 PM
There is a little star icon at the bottom left of each post, give that a click on one of the posts you found helpful. This adds a small amount to the rating of the person who posted the info.
-
A few notes related to program flow.
You really should not create the RS object and open it where you are. This will always issue a query on the database even when you are not going to do...
-
You are still doing the same thing
<%
' *** Insert new category, name and link colour to the database:
Dim CategoryRS
Set CategoryRS = Server.CreateObject("ADODB.Recordset")...
-
You are still not doing it like I showed you
<p class="textEvent">The New Category "
<% Response.Write Request("TypeName")
%>
" Has Been Added To The Database.</p>
<p...
-
Not sure why I did not notice this before
If Not Trim("TypeName")=""Then
This will always be true because it is using a literal string. In other words it will never be empty. It will always...
-
This piece of code is going to execute no matter what the IF statement result was
<% Response.Write Request("TypeName")
%>
You want to write one of two messages depending on what...
-
To get the proper indentation you need to use code tags
Your Code Here
-
Why did you put those *s in there
<%
' *** Insert new category, name and link color to the database:
Dim CategoryRS
Set CategoryRS = Server.CreateObject("ADODB.Recordset")
CategoryRS.Open...
-
June 25th, 2013, 10:26 AM
Look at where your If test is in the code.
Look at where the .AddNew is in the code
They are in different places and as a result your If test is not controlling the addnew. If you want the...
-
June 24th, 2013, 12:26 AM
The code you just showed is not the code that adds to the database. That is just a select statement which will only execute if the If condition is false. From what you said before you want to stop...
-
June 22nd, 2013, 04:50 PM
Well you are not testing it where you add a record
Dim CategoryRS
Set CategoryRS = Server.CreateObject("ADODB.Recordset")
CategoryRS.Open "SELECT * FROM Type", Connect, 2, 3...
-
June 17th, 2013, 09:03 PM
In that case you just need to follow the code through from the point where the message is displayed by your code and see what it does after that. It is to hard to read it on here without code tags...
-
June 17th, 2013, 09:29 AM
You are trapping for an empty string so a string with one or more space will not be picked up by this.
If you want to also filter out strings that maybe be nothing but 1 or more spaces as well...
-
June 16th, 2013, 10:23 AM
This is the part that would add a record
*** Insert new category, name and link color:
Dim CategoryRS
Set CategoryRS = Server.CreateObject("ADODB.Recordset")
CategoryRS.Open "SELECT * FROM...
-
June 14th, 2013, 06:41 PM
I still do not see anything there that would add a record. In fact there is nothing in that last post that would update a record either.
There are 2 basic ways to add a record to the database
1:...
-
June 13th, 2013, 07:33 PM
The only code I saw in there that would modify the data is this
Dim TypeRS
Query = "SELECT * FROM Type WHERE TypeId=" & Request("TypeId")
Set TypeRS = Server.CreateObject("ADODB.Recordset")...
-
June 13th, 2013, 10:16 AM
If your goal is to add a record then you are going about it wrong. Select is used to query the database and return a record that is there.
To add a record you should use the Insert statement and...
-
June 11th, 2013, 06:09 PM
Your If block is all messed up.
If TypeName="" Then
'code here will only execute if the typename is empty
End If
so if typename is not empty none of the code will execute will execute
-
June 10th, 2013, 05:30 PM
An autonumber field populates automatically when you add a record. You can not select using a numeric field in a where clause without a valid numeric value as part of that clause.
to test it you...
-
Your code checks to see if typename is an empty string if it is then it displays a message if it is not then it executes a select statement which uses iType as a where clause but your script does not...
-
You still did not tell us what value is in iType when the code is executed,
If iType is blank you will get an error
Also you told us the field in the db contains numeric data but we could...
-
Unfortunately you did not answer either of my questions.
I assume based on the data and field name that TypeID is a numeric field but I can only guess since you did not say.
You also did not...
-
What value is in iType?
Is TypeID a text field or numeric field in the db?
|
Click Here to Expand Forum to Full Width
|