|
| |
|
|
psoo
Posts: 33 Joined: 9/1/2004 Status: offline
|
INSERT-problem - 9/26/2005 18:23:38
I will insert into a new Access-table (named surf) the name, date and time when the members of my club make a connection to the memberpages. I tried to insert the "INSERT INTO code" but it don't work Where do i insert this "insertcode" INSERT INTO surf (lastname, firstname, date, time) VALUES (' ::lastname::' ?????? ,' ::firstname::'?????? , date(), time()) into the selectcode below ? - in this code (below) i select the name of the 'surfer' to make a welcome greet - i will put his lastname and firstname into the new table (surf) <!--#include file="_fpclass/fpdblib.inc"--> <% fp_sQry="SELECT name,lastname FROM LEDEN WHERE (LedendNr=::uid::)" fp_sDefault="uid=" fp_sNoRecords="<tr><td colspan=2 align=left width=""100%"">Geen records geretourneerd.</td></tr>" fp_sDataConn="Connexion" fp_iMaxRecords=256 fp_iCommandType=1 fp_iPageSize=0 fp_fTableFormat=True fp_fMenuFormat=False fp_sMenuChoice="firstname" fp_sMenuValue="firstname" fp_iDisplayCols=2 fp_fCustomQuery=True BOTID=0 fp_iRegion=BOTID %> <!--#include file="_fpclass/fpdbrgn1.inc"--> <b><font color="#C10000"> <%Dim dtmHour dtmHour = Hour(Now())%> <%If dtmHour >= 6 And dtmHour < 12 Then Response.Write "Good Morning" ElseIf dtmHour >= 12 And dtmHour < 19 Then Response.Write "Good Afternoon" ElseIf dtmHour >= 19 And dtmHour < 23 Then Response.Write "Good Evening" Else Response.Write "Good Night" End If%> <%=FP_FieldVal(fp_rs,"firstname")%>,</b></font> <!--#include file="_fpclass/fpdbrgn2.inc"--> <p style="margin-top: 0; margin-bottom: 0"> </p> Thanks for the hints Pol
|
|
|
|
psoo
Posts: 33 Joined: 9/1/2004 Status: offline
|
RE: INSERT-problem - 9/27/2005 13:25:04
I know that these words are keyword ijn English but not in my language.... My question / problem is quote:
Where and how do i insert this "insertcode" Thanks Pol
|
|
|
|
psoo
Posts: 33 Joined: 9/1/2004 Status: offline
|
RE: INSERT-problem - 9/27/2005 20:34:01
Yes, that's exactly why I will do this. Pol
|
|
|
|
Spooky
Posts: 26606 Joined: 11/11/1998 From: Middle Earth Status: offline
|
RE: INSERT-problem - 9/27/2005 20:55:57
Ideally you would just track the userid, but otherwise, assign the values to a variable eg : Response.Write "Good Night"
End If%>
<%firstname = FP_FieldVal(fp_rs,"firstname")%>
<%lastname = FP_FieldVal(fp_rs,"lastname")%>
<%=FP_FieldVal(fp_rs,"firstname")%>,</b></font> Then add another DRW below this one, and just use insert code you have above (with the following changes)
INSERT INTO surf (lastname, firstname, [date], [time])
VALUES ('"&LastName&"','"&firstname&"', date(), time())
_____________________________
If you arent part of the solution, then there is good money to be made prolonging the problem §þ k¥
|
|
|
|
psoo
Posts: 33 Joined: 9/1/2004 Status: offline
|
RE: INSERT-problem - 9/29/2005 18:16:01
Spooky, I don't understand very good what you mean in your last reply - is it this : in the first SQL string, I think that the two fieldnames are included, as you can see (in my earlier message and) hereafter : fp_sQry="SELECT voornaam,familienaam FROM LEDEN WHERE (LedendNr=::uid::)" fp_sDefault="uid=" ... My surf-table (=the target tabel) works correct when I make a test-select-query. What can be still wrong in the insert codes ? Thanks Pol
|
|
|
|
psoo
Posts: 33 Joined: 9/1/2004 Status: offline
|
RE: INSERT-problem - 9/30/2005 19:52:23
Have you tried : fp_sQry="INSERT INTO surf (familienaam,voornaam,[datum],[tijd]) VALUES ('"&familienaam&"','"&voornaam&"', date(), time())"[/quote] Yes I tried this code but it do not work - this is my code <!--#include file="_fpclass/fpdblib.inc"--> <% fp_sQry="INSERT INTO surf (familienaam,voornaam,[datum],[tijd]) VALUES ('"&familienaam&"','"&voornaam&"', date(), time())" fp_sDefault="" fp_sNoRecords="<tr><td colspan=16 align=left width=""100%"">Geen records geretourneerd.</td></tr>" fp_sDataConn="XYZ" fp_iMaxRecords=256 fp_iCommandType=1 fp_iPageSize=0 fp_fTableFormat=True fp_fMenuFormat=False fp_sMenuChoice="" fp_sMenuValue="" fp_iDisplayCols=16 fp_fCustomQuery=True BOTID=0 fp_iRegion=BOTID %> <!--#include file="_fpclass/fpdbrgn1.inc"--> <!--#include file="_fpclass/fpdbrgn2.inc"--> </tbody> It is apparently very difficult to let work the FontPage Insert-code in combination with the Select-code (see my earlier message). That must nevertheless succeed but how ... Thanks for hints Pol
|
|
|
|
psoo
Posts: 33 Joined: 9/1/2004 Status: offline
|
RE: INSERT-problem - 10/1/2005 19:32:20
The SELECT + INSERT-code <body topmargin="10"> <div align="left"> <table border="0" cellpadding="0" cellspacing="0" width="600"> <tr> <td width="20"></td> <td width="550"><font face="Arial" size="3"> <table width="550"><tr><td> <tbody> <!--#include file="_fpclass/fpdblib.inc"--> <% fp_sQry="SELECT voornaam,familienaam FROM LEDEN WHERE (LedendNr=::uid::)" fp_sDefault="uid=" fp_sNoRecords="<tr><td colspan=2 align=left width=""100%"">Geen records geretourneerd.</td></tr>" fp_sDataConn="XYZ" fp_iMaxRecords=256 fp_iCommandType=1 fp_iPageSize=0 fp_fTableFormat=True fp_fMenuFormat=False fp_sMenuChoice="voornaam" fp_sMenuValue="voornaam" fp_iDisplayCols=2 fp_fCustomQuery=True BOTID=0 fp_iRegion=BOTID %> <!--#include file="_fpclass/fpdbrgn1.inc"--> <b><font color="#C10000"> <%Dim dtmHour dtmHour = Hour(Now())%> <%If dtmHour >= 6 And dtmHour < 12 Then Response.Write "Goede morgen " ElseIf dtmHour >= 12 And dtmHour < 19 Then Response.Write "Goede middag " ElseIf dtmHour >= 19 And dtmHour < 23 Then Response.Write "Goede avond " Else Response.Write "Goede nacht " End If%> <%voornaam = FP_FieldVal(fp_rs,"voornaam")%> <%familienaam = FP_FieldVal(fp_rs,"familienaam")%> <%=FP_FieldVal(fp_rs,"voornaam")%>,</b></font> <!--#include file="_fpclass/fpdbrgn2.inc"--> <p style="margin-top: 0; margin-bottom: 0"> </p> <!--#include file="_fpclass/fpdblib.inc"--> <% fp_sQry="INSERT INTO surf (familienaam,voornaam,[datum],[tijd]) VALUES ('"&familienaam&"','"&voornaam&"', date(), time())" fp_sDefault="" fp_sNoRecords="<tr><td colspan=16 align=left width=""100%"">Geen records geretourneerd.</td></tr>" fp_sDataConn="XYZ" fp_iMaxRecords=256 fp_iCommandType=1 fp_iPageSize=0 fp_fTableFormat=True fp_fMenuFormat=False fp_sMenuChoice="" fp_sMenuValue="" fp_iDisplayCols=16 fp_fCustomQuery=True BOTID=0 fp_iRegion=BOTID %> <!--#include file="_fpclass/fpdbrgn1.inc"--> <!--#include file="_fpclass/fpdbrgn2.inc"--> </tbody> </table> <table> .... Thanks for the hint. Pol
|
|
|
|
psoo
Posts: 33 Joined: 9/1/2004 Status: offline
|
RE: INSERT-problem - 10/2/2005 10:57:34
The code <%voornaam = FP_FieldVal(fp_rs,"voornaam")%> <%familienaam = FP_FieldVal(fp_rs,"familienaam")%> <%=FP_FieldVal(fp_rs,"voornaam")%>, <%=familienaam%> </b></font> gives the following result : "Goede morgen Pol," This could mean that the two variables (<%voornaam= and <%=familienaam=) have no contents ? I do not understand also why the independent variables date() and time() nevertheless are not filled in in the table surf, because a test of the separate insert code (with the following code) is OKAY: the four fields of the table Surf are filled in <!--#include file="_fpclass/fpdblib.inc"--> <% fp_sQry="INSERT INTO surf (familienaam,voornaam,[datum],[tijd]) VALUES ('TEST','TEST1', date(), time())" fp_sDefault="" fp_sNoRecords="<tr><td colspan=16 align=left width=""100%"">Geen records geretourneerd.</td></tr>" fp_sDataConn="XYZ" fp_iMaxRecords=256 fp_iCommandType=1 fp_iPageSize=0 fp_fTableFormat=True fp_fMenuFormat=False fp_sMenuChoice="" fp_sMenuValue="" fp_iDisplayCols=16 fp_fCustomQuery=True BOTID=0 fp_iRegion=BOTID %> <!--#include file="_fpclass/fpdbrgn1.inc"--> <!--#include file="_fpclass/fpdbrgn2.inc"--> Thanks for the hint, Pol
|
|
|
|
psoo
Posts: 33 Joined: 9/1/2004 Status: offline
|
RE: INSERT-problem - 10/3/2005 17:28:53
Also with the "test"codes , there is no 'movement' in the Surf table. The variables remain blank. Strange reason with a difficult solution ? I am strongly interested how this problem can be solved. Otherwise, in an earlier message -dd. 9/27/2005 20:55:57- you (Spooky) wrote : "Ideally you would just track the userid, but otherwise, assign the values to a variable" - Is this (track the userid) perhaps an other and easier solution ? Thanks Pol I tested today this code (after the SELECT-code), but without using the variables <%voornaam and <%familienaam. fp_sQry="INSERT INTO surf (familienaam,voornaam,[datum],[tijd]) VALUES ('test3','test4', date(), time())" However without good result. This is very strange because I tested earlier - successfully - these INSERT-code without the preceding SELECT-code. Is it possible that the problem is situated in the passage of SELECT code to INSERT code or in the bad? combination / passage SELECT- and INSERT-code ? Pol
< Message edited by psoo -- 10/4/2005 19:10:50 >
|
|
|
|
psoo
Posts: 33 Joined: 9/1/2004 Status: offline
|
RE: INSERT-problem - 10/7/2005 19:06:25
My problem is solved. I tested all the time a (duplicated) file that was not linked - excuse me for this stupid (newbee-)error. It works fine now. Thanks for the tips / updates. Now I have the startime (when the surfer enters from the public pages into the memberpages). Is it also possible to obtain the 'stoptime' = when he leaves the memberpages (and perhaps which memberpages he has visited) ? I don't know the 'way' to do this. Thanks for a hint. Pol
|
|
New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
Locked w/ New Messages |
Locked w/o New Messages |
|
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts
|
|
|