General discussion


Access/FrontPage Question

By nichole.alspaugh ·
I've created a very simple form in FP2000 to test that it successfully saves to an Access database that resides on our web server (it does). For my "real" form, I need to have the information save to two SEPARATE tables in my database. I've lookedin FP 'help' and in my FP 2K Bible and I can only find information on saving form results to ONE table. I had originally thought to base the form on a query(with fields from both tables), but only the table names come up in the form properties whenI choose to send the information to a database.

I'd appreciate any and all ideas...thanks!

This conversation is currently closed to new comments.

1 total post (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

Access/FrontPage Question

by robert_a_mocarski In reply to Access/FrontPage Question

It sounds like you are running into a limitation of FP. FP is great for getting started, but I found that I very quickly outgrew it's built in features. I recommend that you either convert to a higher end tool, such as Visual Interdev, or embed yourown ASP code in the FP generated code. FP and Visual Interdev work extremely well together, because you can quickly build a page in FP and then tweak it with Interdev.

Following is some ASP code that can help you do what you are trying to do. Thecode opens a connection to an Access database and then executes a sql command. I've included samples of code from select, update, and append queries. Just change the value of the sqlCommand variable to do what you need to do. Set the sqlCommand and run the Set dbRs line twice to update 2 tables. I know that FP seems easier, but it is limited in what it allows you to do. Feel free to email me with questions.

strConnect = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.Mappath("/path/database.mdb")
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open strConnect
sqlCommand = " SELECT table.* FROM table " _
& "WHERE [table]![field] = value"
Set dbRs = Conn.Execute(sqlCommand)
If Not dbRs.BOF Then
Do While Not dbRs.EOF
rsfieldName = dbRS.Fields("fieldname")
End If
Set Conn = Nothing

SQL to append to a table:
INSERT INTO Table1 ( test )
SELECT Table1.test
FROM Table1
WHERE (((Table1.test)="1"));SQL to update a table:
UPDATE Table1 SET Table1.test = "2"
WHERE (((Table1.test)="1"));

Back to Software Forum
1 total post (Page 1 of 1)  

Related Discussions

Related Forums