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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

using access database instead of sendmail to collect data

Status
Not open for further replies.

dpgrieve

MIS
Jul 25, 2004
4
0
0
US
I have written an ASP page that uses sendmail to send the data collected from a form to my email. I would rather just have it sent to an Access database. What is the syntax to set up this action?

Thanks [dazed]
 
I havnt tested this but:
Code:
<%
Const dbVersion10 = 1
Const dbVersion11 = 8
Const dbVersion20 = 16
Const dbVersion30 = 32
Const dbVersion40 = 64
Sub CreateNewMDB(FileName, Format)
  Dim Engine 
  Set Engine = CreateObject("DAO.DBEngine.36")
  Engine.CreateDatabase FileName, ";LANGID=0x0409;CP=1252;COUNTRY=0", Format
End Sub

'Create Access2000 database
CreateNewMDB "C:\a2000.mdb", dbVersion40

%>

Or using Jet:
Code:
Const Jet10 = 1
Const Jet11 = 2
Const Jet20 = 3
Const Jet3x = 4
Const Jet4x = 5

Sub CreateNewMDB(FileName, Format)
  Dim Catalog
  Set Catalog = CreateObject("ADOX.Catalog")
  Catalog.Create "Provider=Microsoft.Jet.OLEDB.4.0;" & _
     "Jet OLEDB:Engine Type=" & Format & _
    ";Data Source=" & FileName
End Sub

'Create Access2000 database
CreateNewMDB "G:\a2000.mdb", Jet4x

However you could just make a blank database in Access and then in the ASP script copy it and the change the copied database however you please.
 
err...?

Just to clarify, the code sample above create an access database, they don't necessarally save data to an existing database, which is what it sounds like you were aiming for.

There are a lot (huuuuuge tracts of land..err, dangit, wrong subject) of examples of ASP and Access interactions. Your best bet would probably be to go through some tutorials like the ADO tutorials at w3schools so that instead of getting a one time solution you get more general info to make your own modifications and such in the future.

-T

[sub]01000111 01101111 01110100 00100000 01000011 01101111 01100110 01100110 01100101 01100101 00111111[/sub]
The never-completed website:
 
Wow..I uh need to read posts, or just not reply to them when I am half awake...[dazed]

*Points to Tarwn's post*

What I posted is not even ASP script runnable.
 
dpgrieve,

it'd just be a matter of using an ADO object instead of a mail object and passing the value(s) into DB instead of an email.. no biggie, unless you dont know how to use ADO, and for that there's many tutorials online, including here in the faqs

[thumbsup2]DreX
aKa - Robert
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top