Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I migrate a certain FP code to ASP Classic

Status
Not open for further replies.

leifoet

Technical User
Jan 31, 2016
203
BE
I am trying to convert some programs in FP to ASP Classic (server without FP-extensions).
For this FP-code, I do not know how to convert:
fp_sQry="SELECT * FROM ACTIVITY18 WHERE (ActId=::ActId::)"

My migration code
<%
'Dim Conn, rs, sql
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("_myweb/database.mdb")

Set rs = Server.CreateObject("ADODB.Recordset")
sql = "SELECT * FROM ACTIVITY18 WHERE ActId=VARIABLE"
rs.Open sql, Conn
%>

This VARIABLE comes from / is determined in a previous option-selection-module where value (also converted from FP) is defined as follows
<option style="font-family: Arial, Helvetica, sans-serif;color:#0000FF;" value="<%=rs("ActId")%>"><%=rs("Actcat")&" "&rs("ActDate")&" : "&rs("Description")%></p>

Thanks for help.

 
Is this not covered in this thread thread333-1785773 ?

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.

Never mind this jesus character, stars had to die for me to live.
 
This question is not the same as in thread333-1785773: ASP Classic - SELECT query does not work ? (on which I will return)
First I would like to find a solution to this problem.

Thanks for tips.
 
If ActId is a text field in Access:
[tt]sql = "SELECT * FROM ACTIVITY18 WHERE ActId='" & VARIABLE & "'"[/tt]

If ActId is a numeric field in Access:
[tt]sql = "SELECT * FROM ACTIVITY18 WHERE ActId=" & VARIABLE[/tt]

This is pretty much the same question you asked in the other thread and the advice you got there was good. If you still have problems, post the actual code and what errors you are getting.
 
In the same migration story from FP to ASP

original working FP
Endday=weekday(Day(FP_Field(fp_rs,"ActEndDT"))&"/"&Month(FP_Field(fp_rs,"ActEndDT"))&"/"&year(FP_Field(fp_rs,"ActEndDT")))
migration
Endday=weekday(Day(rs("ActEndDT"))&"/"&Month(rs("ActEndDT"))&"/"&year(rs("ActEndDT")))

I get the following error after migration:

Microsoft VBScript runtime error '800a000d'
Type mismatch: '[string: "//"]'

ActEndDT => date (/time) field

Is there a problem with the migration syntax?
 
Probably an error in the concatenation.

print the value of endday to the browser to test the result.

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.

Never mind this jesus character, stars had to die for me to live.
 
Indeed - Error in the concatenation solved.
Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top