RAN
Posts: 28
|
Posted: 05/22/2005, 3:51 PM |
|
Hi,
I have to make a horizontal grid.
I use CC not CCS and ASP and my DB is MSAccess.
I already search in http://www.gotocode.com but only find
the code for ASP for CCS or PHP for CC and I need ASP for CC.
Can anyone help me and past this code for asp?
Open event:
$i = 0;
$sWhere = " where c.par_category_id is Null";
$rec_count = dLookUp("categories", "count(*)", "par_category_id is Null");
$rec_count--;
CustomShow event:
$point = $i/3;
if (strpos($point, ".") == "")
if ($i == 0)
echo "<tr>";
else
echo "</tr><tr>";
?>
<td bgcolor="#E4B6DE" style="border: 4 solid #A0038C"><font color="#000000" style="font-size: 11px; font-family: Tahoma, Verdana, Arial;"><a href="<?=$fldname_URLLink?>?category_id=<?=$fldname_category_id?>&"><font color="#000000" style="font-size: 11px; font-family: Tahoma, Verdana, Arial;"><?=$fldname?></font></a> </font></td>
<?
if ($i == $rec_count)
echo "</tr>";
$i++;
I already try this link : http://www.gotocode.com/UserImages/Elena/SColumns.ccs
But is a broken link...
Thank you in advance
Rui Nunes
|
|
|
Nicole
Posts: 586
|
Posted: 05/23/2005, 4:52 AM |
|
Ran,
Relevant ASP code is
Open event
i = 0
sWhere = " where c.par_category_id is Null"
rec_count = dLookUp("categories", "count(*)", "par_category_id is Null") rec_count = rec_count -1
'response.write "number of records " & rec_count & "<br>"
Custom Show event
if int(i/3) = i/3 then
if i = 0 then
%> <tr> <%
else
%> </tr><tr> <%
end if
end if
%> <td bgcolor="#E4B6DE" style="border: 4 solid #A0038C"><font color="#000000" style="font-size: 11px; font-family: Tahoma, Verdana, Arial;"><a href="<%=fldname_URLLink%>?category_id=<%=fldname_category_id%>&"><font color="#000000" style="font-size: 11px; font-family: Tahoma, Verdana, Arial;"><%=fldname%></font></a> </font></td>
<%
if i = rec_count then
%> </tr> <%
end if
i=i+1
_________________
Regards,
Nicole |
|
|
RAN
Posts: 28
|
Posted: 05/23/2005, 6:58 AM |
|
Dear Nicole,
Thank you very much for your great help.
I already can make a horizontal grid but...
the pass parameter and other things dont work anymore.
If you can spend a little of your time
Working link with vertical grid passing parameters OK: http://www.umbicap.com/umbicap/default_produtos.asp?Produto_ID=51&
With the horizontal code: http://www.umbicap.com/umbicap/default_produtos_1.asp?Produto_ID=51&
Link of the default_produtos.asp http://www.umbicap.com/umbicap/umbicap1.rar
Can you help me please?
Thank you,
Rui Nunes
|
|
|
Nicole
Posts: 586
|
Posted: 05/24/2005, 1:46 AM |
|
Ran,
As I see you’re using ASP+Templates code generating pattern, but example is created for templateless ASP pattern.
_________________
Regards,
Nicole |
|
|
RAN
Posts: 28
|
Posted: 05/24/2005, 6:45 AM |
|
Dear Nicole
Thank you one more time.
Now I have a ASP without templates. Its better but give me a page like that. http://www.umbicap.com/umbicap/default_produtos.asp?Produto_ID=51&
This code works with pass parameters?
The Asp code http://www.umbicap.com/umbicap/default_produtos.rar
Thank you,
Rui Nunes
|
|
|
Nicole
Posts: 586
|
Posted: 05/24/2005, 7:27 AM |
|
Ran,
I see that you’re making a progress, you’ve got rows grid.
But you need to adapt this code snippet
<td bgcolor="#E4B6DE" style="border: 4 solid #A0038C"><font color="#000000" style="font-size: 11px; font-family: Tahoma, Verdana, Arial;"><a href="<%=fldname_URLLink%>?category_id=<%=fldname_category_id%>&"><font color="#000000" style="font-size: 11px; font-family: Tahoma, Verdana, Arial;"><%=fldname%></font></a> </font></td>
to output Image Link (or Image if you want) and use HTML you like
_________________
Regards,
Nicole |
|
|
RAN
Posts: 28
|
Posted: 05/24/2005, 11:16 AM |
|
Thank you Nicole,
And can you tell me how to adapt it to work like that? http://www.umbicap.com/umbicap/default_produtos_3.asp?Produto_ID=51&
Can you give me a tips?
Thank you,
Rui Nunes
|
|
|
RAN
Posts: 28
|
Posted: 05/24/2005, 4:28 PM |
|
Dear Nicole,
The code is almost done. You can see on http://www.umbicap.com/umbicap/default_produtos.asp?ID=143&Produto_ID=51&
But the grid is not good enough.
I think this is the problem. When I insert this code on Open event the grid dosent work anymore:
Open event:
i = 0
sWhere = " where c.id is Null"
rec_count = dLookUp("categories", "count(*)", "id is Null")
rec_count = rec_count -1
'response.write "number of records " & rec_count & "<br>"
Give me always this error:
/umbicap/Common.asp, linha 42
I think this code need the connection with the DB...
Can you help me please?
Thank you,
Rui Nunes
|
|
|
Nicole
Posts: 586
|
Posted: 05/25/2005, 3:29 AM |
|
Hmm.. the problem may be with sql
Select count(*) from categories where id is Null
I recommend you to test this query against the database to make sure it returns a valid data.
_________________
Regards,
Nicole |
|
|
RAN
Posts: 28
|
Posted: 05/26/2005, 3:49 AM |
|
Dear Nicole,
Do you mean:
i = 0
sWhere = " where c.Menu_id is Null"
rec_count = dLookUp("Select count(*)", "from Produtos", "where Menu_id is Null")
rec_count = rec_count -1
'response.write "number of records " & rec_count & "<br>"
Give me a error Common.asp, linha 42
I think i dont know how to change this script:
Could you help me a little bit
Thank you.
Rui Nunes
|
|
|
Nicole
Posts: 586
|
Posted: 05/26/2005, 6:04 AM |
|
Yes, I think that this script may produce an error. Script itself is correct, bit sql query which it executes may be not valid.
_________________
Regards,
Nicole |
|
|
RAN
Posts: 28
|
Posted: 05/26/2005, 6:29 AM |
|
And Nicole
Can you give me some tip?
Thank you,
Rui Nunes
|
|
|
mrachow
Posts: 509
|
Posted: 05/26/2005, 8:18 AM |
|
You don't have to use the SQL keywords in dLookUp, e.g.
rec_count = dLookUp("Produtos", "count(*)", "Menu_id is Null")
_________________
Best regards,
Michael |
|
|
RAN
Posts: 28
|
Posted: 05/26/2005, 12:02 PM |
|
Dear Nicole,
I dont know if the change I made in the script is badly done.
But I remove this part of thee script and seems to work now:
The final script?!
i = 0
rec_count = dLookUp("Modelos", "count(*)", "Menu_id is Null")
rec_count = rec_count -1
'response.write "number of records " & rec_count & "<br>"
I remove this part:
sWhere = " where c.Menu_id is Null"
Thank you Nicole,
Rui Nunes
|
|
|
RAN
Posts: 28
|
Posted: 05/26/2005, 2:09 PM |
|
Dear Michael,
Sorry, I dont see your name and I think is Nicole to answer me.
Thank you very much for your great help and
Thank you,
Rui Nunes
|
|
|
mrachow
Posts: 509
|
Posted: 05/26/2005, 11:39 PM |
|
Absolutly no problem.
Nicole deserve each thanks.
_________________
Best regards,
Michael |
|
|
Nicole
Posts: 586
|
Posted: 05/27/2005, 1:40 AM |
|
Rui,
I’ve just visited your page http://www.umbicap.com/umbicap/default_produtos.asp?ID=143&Produto_ID=51&
and I see that if you still use the following code snippets:
rec_count = dLookUp("Modelos", "count(*)", "Menu_id is Null")
rec_count = rec_count -1
and
if i = rec_count then
%> </tr> <%
end if
then rec_count value is not valid. It should return 5 in your case. It means that query in DLookUp is not valid. So I can propose two ways:
- modify query (test it against database to make sure it is valid);
- remove 2 aforementioned code snippets. Produces HTML code will be not absolutely correct, but it is OK for IER browser.
_________________
Regards,
Nicole |
|
|
u6hjmhk,
|
Posted: 08/24/2005, 7:11 AM |
|
|
|
|
|