Hi
I am still new to ASP. I have created a single form. I retrieve the data from the form and place it in variables and then submit the data to an access database.
Another company then requires certain fields from the database *once a week/monthly(to be established in CSV file format.
How will my asp code below know when and how to write to the CSV file? Surely I should add some code to my asp code so that when it submits the data to the database, it submits the values to the CSV file? Or, does the writing to the CSV file not happen when the data is submitted to the database? Do I do this manually?
If the data needs to be written to a CSV file once a week, then how does this happen and who does it and whereabouts does it happen? Where should a command be run and and what command should be run to 'write it'.
Here's my code which submits to the database. I retrieve a lot more data, but have cut it down to simplify. Also, I may want to only write some of the data retrieved from the form - not all.
Set cndb = server.CreateObject("adodb.connection"
Set cmdaddtodatabase = server.CreateObject("adodb.command"
cndb.CommandTimeout = 15
cndb.CursorLocation = adUseServer
'cndb.ConnectionString = "DSN=cXX" 'this is for local
cndb.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=d:\webs/xxxxxxx/db/1CM_S2P.mdb"
on error resume next
cndb.open
if err <> 0 then
response.write "Error connecting to the database"
response.end
end if
With cmdaddtodatabase
.CommandTimeout = 15
set .ActiveConnection = cndb
.CommandType = adCmdText
.CommandText = "INSERT INTO S2P_Applicant_Details (Title, FirstName) VALUES ('"&strTitle&"','"&strFirstName&"')"
.Parameters.Append(.CreateParameter ("pTitle", adVarChar,adParamInput,50, strTitle))
.Parameters.Append(.CreateParameter ("pFirstName", adVarChar,adParamInput,50, strFirstName))
on error resume next
.Execute
if err.number <> 0 then
Response.write err.description
Response.End
end if
End with
%>
Really appreciate this.
Thanks
Lee
I am still new to ASP. I have created a single form. I retrieve the data from the form and place it in variables and then submit the data to an access database.
Another company then requires certain fields from the database *once a week/monthly(to be established in CSV file format.
How will my asp code below know when and how to write to the CSV file? Surely I should add some code to my asp code so that when it submits the data to the database, it submits the values to the CSV file? Or, does the writing to the CSV file not happen when the data is submitted to the database? Do I do this manually?
If the data needs to be written to a CSV file once a week, then how does this happen and who does it and whereabouts does it happen? Where should a command be run and and what command should be run to 'write it'.
Here's my code which submits to the database. I retrieve a lot more data, but have cut it down to simplify. Also, I may want to only write some of the data retrieved from the form - not all.
Set cndb = server.CreateObject("adodb.connection"
Set cmdaddtodatabase = server.CreateObject("adodb.command"
cndb.CommandTimeout = 15
cndb.CursorLocation = adUseServer
'cndb.ConnectionString = "DSN=cXX" 'this is for local
cndb.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=d:\webs/xxxxxxx/db/1CM_S2P.mdb"
on error resume next
cndb.open
if err <> 0 then
response.write "Error connecting to the database"
response.end
end if
With cmdaddtodatabase
.CommandTimeout = 15
set .ActiveConnection = cndb
.CommandType = adCmdText
.CommandText = "INSERT INTO S2P_Applicant_Details (Title, FirstName) VALUES ('"&strTitle&"','"&strFirstName&"')"
.Parameters.Append(.CreateParameter ("pTitle", adVarChar,adParamInput,50, strTitle))
.Parameters.Append(.CreateParameter ("pFirstName", adVarChar,adParamInput,50, strFirstName))
on error resume next
.Execute
if err.number <> 0 then
Response.write err.description
Response.End
end if
End with
%>
Really appreciate this.
Thanks
Lee