Hi know ?
how to find all colors_id in product_colours again particularly prod_id -
Dim SQL1, rsColours
-
'which one is the best way to doing it ?
-
SQL1 = "select * from product_colours where prod_id='" & pd & "'"
-
or
-
SQL1 = "select * from colors,product_colours where colors.id = color_id and prod_id='" & pd & "'"
-
-
set rsColours = Server.CreateObject("ADODB.RecordSet")
-
rsColours.open SQL1, ConString,adOpenKeyset,adLockReadOnly
-
-
Do While not rsColours.EOF
-
rsColours("color_id")
-
rsColours.MoveNext
-
Loop
-
-
i need to change the following values to checked or not checked ?
-
-
<input type="checkbox" name="3" value="3"
-
<% If rsColours("color_id") = "3" Then Response.Write "checked" end if %>>
-
-
<input type="checkbox" name="4" value="4"
-
<% If rsColours("color_id") = "4" Then Response.Write "checked" end if %>>
-
-
so on & so 4th . . .
-
thx in advance
9 1564
Hi know ?
how to find all colors_id in product_colours again particularly prod_id -
Dim SQL1, rsColours
-
'which one is the best way to doing it ?
-
SQL1 = "select * from product_colours where prod_id='" & pd & "'"
-
or
-
SQL1 = "select * from colors,product_colours where colors.id = color_id and prod_id='" & pd & "'"
-
-
set rsColours = Server.CreateObject("ADODB.RecordSet")
-
rsColours.open SQL1, ConString,adOpenKeyset,adLockReadOnly
-
-
Do While not rsColours.EOF
-
rsColours("color_id")
-
rsColours.MoveNext
-
Loop
-
-
i need to change the following values to checked or not checked ?
-
-
<input type="checkbox" name="3" value="3"
-
<% If rsColours("color_id") = "3" Then Response.Write "checked" end if %>>
-
-
<input type="checkbox" name="4" value="4"
-
<% If rsColours("color_id") = "4" Then Response.Write "checked" end if %>>
-
-
so on & so 4th . . .
-
thx in advance
Hi , Fary
If your product_colors table contains both color_id and product_id then you can use this code; - SQL1 = "SELECT color_id FROM product_colors WHERE product_id ="'" & pd "'"
Godd day
Hi thank for reply -
Dim SQL1, rsColours
-
SQL1 = "SELECT color_id FROM product_colours WHERE prod_id ='" & pd & "'"
-
set rsColours = Server.CreateObject("ADODB.RecordSet")
-
rsColours.open SQL1, ConString,adOpenKeyset,adLockReadOnly
-
Do While not rsColours.EOF
-
rsColours("color_id")
-
rsColours.MoveNext
-
Loop
-
it's not working mean rsColours("color_id") not taking any value it's giving me this error ? -
Error Type:
-
Microsoft VBScript runtime (0x800A01C2)
-
Wrong number of arguments or invalid property assignment
-
/localhost/edit.asp, line 6
-
any solution ?
Hi thank for reply -
Dim SQL1, rsColours
-
SQL1 = "SELECT color_id FROM product_colours WHERE prod_id ='" & pd & "'"
-
set rsColours = Server.CreateObject("ADODB.RecordSet")
-
rsColours.open SQL1, ConString,adOpenKeyset,adLockReadOnly
-
Do While not rsColours.EOF
-
rsColours("color_id")
-
rsColours.MoveNext
-
Loop
-
it's not working mean rsColours("color_id") not taking any value it's giving me this error ? -
Error Type:
-
Microsoft VBScript runtime (0x800A01C2)
-
Wrong number of arguments or invalid property assignment
-
/localhost/edit.asp, line 6
-
any solution ?
Hi , Fary
Just put a response statement after the query and see if it's working properly or not. Only output will be the Query and then copy it and try it in SqlQuery analyzer, If the Query ok or not.
Thanks.
Hi their is no problem to execute this code but
if i'll do this in select statment -
<select size="1"><%Do While Not rscolours.EOF %>
-
-
<option value="<%= rssize2("color_id")%>"><%= rssize2("color_id")%></option>
-
<%
-
rscolours.MoveNext
-
loop
-
%></select><% rsColours.MoveNext
-
Loop
-
BUT IF I USE THIS CODE
-
-
Do While not rsColours.EOF
-
rsColours("color_id") ' this line is error ?
-
rsColours.MoveNext
-
Loop
-
-
MY MAIN PROBLEM THIS
-
i need to change the following values to checked or not checked ?
-
-
<input type="checkbox" name="3" value="3"
-
<% If rsColours("color_id") = "3" Then Response.Write "checked" end if %>>
-
-
<input type="checkbox" name="4" value="4"
-
<% If rsColours("color_id") = "4" Then Response.Write "checked" end if %>>
-
that's not working . . . any solution for to over come this ?
Regards
Farhan
Hi their is no problem to execute this code but
if i'll do this in select statment -
<select size="1"><%Do While Not rscolours.EOF %>
-
-
<option value="<%= rssize2("color_id")%>"><%= rssize2("color_id")%></option>
-
<%
-
rscolours.MoveNext
-
loop
-
%></select><% rsColours.MoveNext
-
Loop
-
BUT IF I USE THIS CODE
-
-
Do While not rsColours.EOF
-
rsColours("color_id") ' this line is error ?
-
rsColours.MoveNext
-
Loop
-
-
MY MAIN PROBLEM THIS
-
i need to change the following values to checked or not checked ?
-
-
<input type="checkbox" name="3" value="3"
-
<% If rsColours("color_id") = "3" Then Response.Write "checked" end if %>>
-
-
<input type="checkbox" name="4" value="4"
-
<% If rsColours("color_id") = "4" Then Response.Write "checked" end if %>>
-
that's not working . . . any solution for to over come this ?
Regards
Farhan
Hi , Fary
Could you please give me a comprehensive description about your table structures.
That is the tables you are using with all their column names, etc.
Thanks.
DATABASE CONTAINS ( Product ID & Color ID )
like Product ID 22 , 23 , 24 . . . n
but
Color ID available for each product ID with multipule Colors Black(1), Blue(2), Brown(3) . . . Yellow(n) Etc.
the following code taking values from prod_id = 23 AND
all it's colors which is Black(1), Blue(2), Brown(3) . . . Yellow(n) - <%
-
pd = 23
-
SQL1 = "SELECT * from PRODUCT_SIZES where prod_id='" & pd & "'"
-
set rsColours = Server.CreateObject("ADODB.RecordSet")
-
rsColours.open SQL1, ConString,adOpenKeyset,adLockReadOnly
-
%>
-
<input type="checkbox" name="1" value="2" <% If rsColours("color_id") = "2" Then Response.Write "checked" end if %>>
-
<input type="checkbox" name="2" value="3" <% If rsColours("color_id") = "3" Then Response.Write "checked" end if %>>
-
.
-
.
-
.
-
<input type="checkbox" name="n" value="n" <% If rsColours("color_id") = "n" Then Response.Write "checked" end if %>>
-
after execute it's bring check & uncheck values from final page
DATABASE CONTAINS ( Product ID & Color ID )
like Product ID 22 , 23 , 24 . . . n
but
Color ID available for each product ID with multipule Colors Black(1), Blue(2), Brown(3) . . . Yellow(n) Etc.
the following code taking values from prod_id = 23 AND
all it's colors which is Black(1), Blue(2), Brown(3) . . . Yellow(n) - <%
-
pd = 23
-
SQL1 = "SELECT * from PRODUCT_SIZES where prod_id='" & pd & "'"
-
set rsColours = Server.CreateObject("ADODB.RecordSet")
-
rsColours.open SQL1, ConString,adOpenKeyset,adLockReadOnly
-
%>
-
<input type="checkbox" name="1" value="2" <% If rsColours("color_id") = "2" Then Response.Write "checked" end if %>>
-
<input type="checkbox" name="2" value="3" <% If rsColours("color_id") = "3" Then Response.Write "checked" end if %>>
-
.
-
.
-
.
-
<input type="checkbox" name="n" value="n" <% If rsColours("color_id") = "n" Then Response.Write "checked" end if %>>
-
after execute it's bring check & uncheck values from final page
Hi Fary, -
pd_id = 2
-
Set Conn = Server.CreateObject("ADODB.Connection")
-
Conn.ConnectionString = "Provider=SQLOLEDB;" & _
-
"Data Source=" & DATABASE_SERVER & ";" & _
-
"Initial Catalog=" & DATABASE_NAME & ";" & _
-
"User ID=" & DATABASE_USER & ";" & _
-
"Password=" & DATABASE_PASSWORD & ";" & _
-
"Persist Security Info=false;"
-
Conn.Open '//Open Connection
-
SQL1 = "SELECT * FROM TABLE_NAME WHERE product_id = '" & pd_id & "'"
-
set rsColours = Server.CreateObject("ADODB.RecordSet")
-
set rsColours = Conn.Execute(SQL1)
-
count = 0
-
dim str()
-
while not rsColours.EOF
-
if count = 0 then
-
redim str(0)
-
str(count) = rsColours("color_id")
-
else
-
redim preserve str(count)
-
str(count) = rsColours("color_id")
-
end if
-
rsColours.MoveNext
-
count = count + 1
-
Wend
-
t = ubound(str)
-
%>
-
<input type="checkbox" name="1" value="1"
-
<%
-
for i = 0 to t
-
If str(i) = 1 then
-
response.write("checked")
-
end if
-
next
-
%>/>
-
<input type="checkbox" name="2" value="2"
-
<%
-
for i = 0 to t
-
If str(i) = 2 then
-
response.write("checked")
-
end if
-
next
-
%>/>
-
<input type="checkbox" name="3" value="3"
-
<%
-
for i = 0 to t
-
If str(i) = 3 then
-
response.write("checked")
-
end if
-
next
-
%>/>
-
<input type="checkbox" name="4" value="4"
-
<%
-
for i = 0 to t
-
If str(i) = 4 then
-
response.write("checked")
-
end if
-
next
-
%>/>
-
<input type="checkbox" name="5" value="5"
-
<%
-
for i = 0 to t
-
If str(i) = 5 then
-
response.write("checked")
-
end if
-
next
-
%>/>
-
<input type="checkbox" name="6" value="6"
-
<%
-
for i = 0 to t
-
If str(i) = 6 then
-
response.write("checked")
-
end if
-
next
-
%>/>
-
<input type="checkbox" name="7" value="7"
-
<%
-
for i = 0 to t
-
If str(i) = 7 then
-
response.write("checked")
-
end if
-
next
-
%>/>
I have modified your code.
Just take a look.
You can make connection as you like.
Inform if any problem
Have a good day !
Hi
Thanks for the code it's well worth it which i'm trying 2 do
onec again realy thx for you participation
if possible plz take a look following code it's same part of the coding
http://www.thescripts.com/forum/thread731823.html
Hi
Thanks for the code it's well worth it which i'm trying 2 do
onec again realy thx for you participation
if possible plz take a look following code it's same part of the coding
http://www.thescripts.com/forum/thread731823.html
Hi Fary
You are most welcome.
have a good day.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: sabarish |
last post by:
Hi to all. find out the biggest among two numbers without using any
conditional statements and any relational operators.
|
by: John Wood |
last post by:
Even though CSC does its best to detect use of unassigned variables, it
often misses it... for example if you just declare a double in a class
without assigning a default value, it has a default...
|
by: Roy Gourgi |
last post by:
Hi,
How can I insert variables instead of values in the VALUES() part of the
insert into command, i.e.
var1=10;
var2=20;
var3=30
insert into emp_test (emp_no1, emp_no2, emp_no3) VALUES...
|
by: Roger |
last post by:
I have a datagrid and would like to know what even fires when a cell is
changed?
I want to know when the user changes a cell and moves to the next. I have
some code that needs to be done to...
|
by: ventre-à-pattes |
last post by:
I have no idea where to look for this.
Database about wines.
One table is `product` (one particular wine from one particular estate)
with a link to a second table `appellation` (legal...
|
by: usenet |
last post by:
How and where can one find out about the basics of VB/Access2003
syntax?
I am a died in the wool C/C++/Java Linux/Unix programmer and I am
finding it difficult to understand the program format...
|
by: Chuy08 |
last post by:
If I have a multdimensional array like so:
$records = array(
array('product' ='30 year','rate'=6.0 'ProgramID' =>9514),
array('product' ='30 year','rate'=6.0 'ProgramID' =>9514),...
|
by: dancole42 |
last post by:
So I have a subform that lists the various items on a particular
invoice.
First, the user selects a product class from the Class dropdown. This
is bound to the Class field in the InvioceLines...
|
by: Satish Itty |
last post by:
How do I write the following c# code in vb
Product FindProduct(string code)
{
List<Productproducts = getProducts();
return products.Find(delegate(Product bo)
{ return bo.Code == code; });
}
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
| |