mcomens
asked on
I'm confused about a Custom Query in Databse Results Wizard. Extremely Urgent.
Hello Experts,
I have gone through the White Paper from Microsoft KB288328 and created a website that can upload, send e-mail and write tto a database simutaneously. I have looked through several questions here as well but still have a problem.
While all seems to be working fine, (I receive an e-mail the file uploads and the Upload sucess message shows from process2.asp) when I look in the Database table Results I do not get the data placed into the table but rather the field names. I am using the following for a custom query in process2.asp
INSERT INTO Results ([FullName], [Email], [PhoneNumber], [Advertiser], [IssueDate], [AdSize], [AdShape], [File]) VALUES ('FullName','Email','Phone Number','A dvertiser' ,'IssueDat e','AdSize ','AdShape ','File')
I am really confused as to what I am doing wrong. Can someone please help me I have been stuggling with this for a couple of weeks and really need to get this done.
Thank you in advance.
msc
I have gone through the White Paper from Microsoft KB288328 and created a website that can upload, send e-mail and write tto a database simutaneously. I have looked through several questions here as well but still have a problem.
While all seems to be working fine, (I receive an e-mail the file uploads and the Upload sucess message shows from process2.asp) when I look in the Database table Results I do not get the data placed into the table but rather the field names. I am using the following for a custom query in process2.asp
INSERT INTO Results ([FullName], [Email], [PhoneNumber], [Advertiser], [IssueDate], [AdSize], [AdShape], [File]) VALUES ('FullName','Email','Phone
I am really confused as to what I am doing wrong. Can someone please help me I have been stuggling with this for a couple of weeks and really need to get this done.
Thank you in advance.
msc
ASKER
Data from a form get written to a text file .csv then inserted to the database through .asp page with the custom query.
Using .asp to Access database from Frontpage 2003 which creates a webot.
Below is the code for the webot.
<!--webbot bot="DatabaseRegionStart" s-columnnames s-columntypes s-dataconnection="Form" b-tableformat="FALSE" b-menuformat="FALSE" s-menuchoice s-menuvalue b-tableborder="TRUE" b-tableexpand="TRUE" b-tableheader="TRUE" b-listlabels="FALSE" b-listseparator="FALSE" i-listformat="0" b-makeform="FALSE" s-recordsource s-displaycolumns s-criteria s-order s-sql="INSERT INTO Results (FullName, Email, PhoneNumber, Advertiser, IssueDate, AdSize, AdShape, File) VALUES ('FullName','Email','Phone Number','A dvertiser' ,'IssueDat e','AdSize ','AdShape ','File')" b-procedure="FALSE" clientside suggestedext="asp" s-defaultfields s-norecordsfound="Your file has been successfully Uploaded!" i-maxrecords="256" i-groupsize="0" botid="0" u-dblib="_fpclass/fpdblib. inc" u-dbrgn1="_fpclass/fpdbrgn 1.inc" u-dbrgn2="_fpclass/fpdbrgn 2.inc" tag="BODY" preview="<table border=0 width="100%"> <tr> <td bgcolor="#FFFF00" ;><f ont color="#000000"& gt;This is the start of a Database Results region.</font></t d></ tr>< /table> " startspan b-UseDotNET="FALSE" CurrentExt sa-InputTypes b-DataGridFormat="FALSE" b-DGridAlternate="TRUE" sa-CritTypes b-WasTableFormat="FALSE" --><!--#include file="_fpclass/fpdblib.inc "-->
<% if 0 then %>
<SCRIPT Language="JavaScript">
document.write("<div style='background: yellow; color: black;'>The Database Results component on this page is unable to display database content. The page must have a filename ending in '.asp', and the web must be hosted on a server that supports Active Server Pages.</div>");
</SCRIPT>
<% end if %>
<%
fp_sQry="INSERT INTO Results (FullName, Email, PhoneNumber, Advertiser, IssueDate, AdSize, AdShape, File) VALUES ('FullName','Email','Phone Number','A dvertiser' ,'IssueDat e','AdSize ','AdShape ','File')"
fp_sDefault=""
fp_sNoRecords="Your file has been successfully Uploaded!"
fp_sDataConn="Form"
fp_iMaxRecords=256
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=False
fp_fMenuFormat=False
fp_sMenuChoice=""
fp_sMenuValue=""
fp_sColTypes="&"
fp_iDisplayCols=16
fp_fCustomQuery=True
BOTID=0
fp_iRegion=BOTID
%>
<!--#include file="_fpclass/fpdbrgn1.in c"-->
<!--webbot bot="DatabaseRegionStart" endspan i-checksum="9153" -->
Regards,
msc
Using .asp to Access database from Frontpage 2003 which creates a webot.
Below is the code for the webot.
<!--webbot bot="DatabaseRegionStart" s-columnnames s-columntypes s-dataconnection="Form" b-tableformat="FALSE" b-menuformat="FALSE" s-menuchoice s-menuvalue b-tableborder="TRUE" b-tableexpand="TRUE" b-tableheader="TRUE" b-listlabels="FALSE" b-listseparator="FALSE" i-listformat="0" b-makeform="FALSE" s-recordsource s-displaycolumns s-criteria s-order s-sql="INSERT INTO Results (FullName, Email, PhoneNumber, Advertiser, IssueDate, AdSize, AdShape, File) VALUES ('FullName','Email','Phone
<% if 0 then %>
<SCRIPT Language="JavaScript">
document.write("<div style='background: yellow; color: black;'>The Database Results component on this page is unable to display database content. The page must have a filename ending in '.asp', and the web must be hosted on a server that supports Active Server Pages.</div>");
</SCRIPT>
<% end if %>
<%
fp_sQry="INSERT INTO Results (FullName, Email, PhoneNumber, Advertiser, IssueDate, AdSize, AdShape, File) VALUES ('FullName','Email','Phone
fp_sDefault=""
fp_sNoRecords="Your file has been successfully Uploaded!"
fp_sDataConn="Form"
fp_iMaxRecords=256
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=False
fp_fMenuFormat=False
fp_sMenuChoice=""
fp_sMenuValue=""
fp_sColTypes="&"
fp_iDisplayCols=16
fp_fCustomQuery=True
BOTID=0
fp_iRegion=BOTID
%>
<!--#include file="_fpclass/fpdbrgn1.in
<!--webbot bot="DatabaseRegionStart" endspan i-checksum="9153" -->
Regards,
msc
ASKER
barret,
I do not understand what you mean by 'testparameter1'. Please clarify.
msc
I do not understand what you mean by 'testparameter1'. Please clarify.
msc
Hi,
Why are the results written to a .csv file not directly to the database from the form?
Do you actually fine the words FullName, Email..... etc written in the table, or the table is empty?
Why are the results written to a .csv file not directly to the database from the form?
Do you actually fine the words FullName, Email..... etc written in the table, or the table is empty?
ASKER
Hello,
The results are written to the .csv file and not directly to the database becuase the MS Whitepaper says that to be able to e-mail results write to database and use the upload component simultaneously you must use this method. If thier is a better way to do this I am very open to suggestions. I must be able to do all three things with very little user interaction, such as fill out the form and choose the file that want uploaded and submit.
I do actually find the words FullName, Email etc... written in the table. I have changes words in the INSERT INTO query and what ever I put in the query is what gets written to the table.
I have a Process1.asp that has a select statement:
Select * From form_results.csv
This should loop to and select the last record in the .csv file (which doers contain the data from the form) and post to the process2.asp in which the INSERT INTO query should place the data into the table. It seems to me that the my Select is not getting the data to the process2.asp.
Howerver I am new to this type of setup and maybe missing somethiong I just cannot find what it is I am missing.
msc
The results are written to the .csv file and not directly to the database becuase the MS Whitepaper says that to be able to e-mail results write to database and use the upload component simultaneously you must use this method. If thier is a better way to do this I am very open to suggestions. I must be able to do all three things with very little user interaction, such as fill out the form and choose the file that want uploaded and submit.
I do actually find the words FullName, Email etc... written in the table. I have changes words in the INSERT INTO query and what ever I put in the query is what gets written to the table.
I have a Process1.asp that has a select statement:
Select * From form_results.csv
This should loop to and select the last record in the .csv file (which doers contain the data from the form) and post to the process2.asp in which the INSERT INTO query should place the data into the table. It seems to me that the my Select is not getting the data to the process2.asp.
Howerver I am new to this type of setup and maybe missing somethiong I just cannot find what it is I am missing.
msc
I'll check the white paper and get back to you.
ASKER
Thank You I will look over all I have done to check for typos and such again.
msc
msc
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
So if my database is called From.mdb and the table is called results and the fieldname is FullName, would my parameter be
values (Results.FullName)
msc
values (Results.FullName)
msc
ASKER
OK I just thought about my last comment and realised I cannot use that as an example since that is where I am trying to insert the data. Sometimes I type before I think I guess.
With the form data being written to a .csv file and the select statement being used mentioned in a previous comment I am not sure what my parameter would be.
msc
With the form data being written to a .csv file and the select statement being used mentioned in a previous comment I am not sure what my parameter would be.
msc
ASKER
Does anyone one have an idea on how to make this work or is this just not doable with FP2003?
msc
msc
Here is a simple example using asp.net and and access database notice how I am sending the @message as a parameter value which comes from txt1.Text box.
Sub Button_Click( Sender As Object, e As EventArgs)
Dim conMyData As OledbConnection
Dim cmdSelect3 As OledbCommand
dim dbPath As String
dbPath=System.AppDomain.Cu rrentDomai n.BaseDire ctory()
dbPath+= "\.\marquee.mdb"
If IsValid Then
conMyData = New OledbConnection( "Provider=Microsoft.Jet.OL EDB.4.0; Data Source="& dbPath )
cmdSelect3 = New OledbCommand( "update text_source set message=@message where id=1", conMyData )
cmdSelect3.Parameters.Add( "@message", txt1.Text )
cmdSelect3.Connection.Open ()
cmdSelect3.ExecuteNonQuery ()
cmdSelect3.Connection.Clos e()
End If
if Page.IsPostBack Then
Response.Redirect("congrat s3.aspx")
end if
End Sub
Hope this is helpful
Sub Button_Click( Sender As Object, e As EventArgs)
Dim conMyData As OledbConnection
Dim cmdSelect3 As OledbCommand
dim dbPath As String
dbPath=System.AppDomain.Cu
dbPath+= "\.\marquee.mdb"
If IsValid Then
conMyData = New OledbConnection( "Provider=Microsoft.Jet.OL
cmdSelect3 = New OledbCommand( "update text_source set message=@message where id=1", conMyData )
cmdSelect3.Parameters.Add(
cmdSelect3.Connection.Open
cmdSelect3.ExecuteNonQuery
cmdSelect3.Connection.Clos
End If
if Page.IsPostBack Then
Response.Redirect("congrat
end if
End Sub
Hope this is helpful
Thanks,