Techadvice.com

Main,
Tech Info,
Glossary,
Companies,
Hardware
.
Software.
Windows 95, 98, ME, XP,
NT4, 2000, Errors,
Applications
,
Search products ,
Search FAQs.
Shop
Companies,
Products
,


IDC example 1 | Applications | IDC |


 

Example: Show ALL database records

Note: These examples are written for use with FrontPage 97.

These examples work using MS Access. The Database is named "IDCTest.mdb", a table named "TestTable" is used which has the fields "IDnumber", "Name" and "Misc". The DSN file name is IDCsample.

The Database

Create a new database and name it "IDCTest.mdb"

Create a table in the database

This table is saved as "TestTable", and you can add some data into this table for testing.

Create the DSN

Open the control panel and double click on the ODBC icon. The "ODBCData Source Administrator" windows will open.

Click on the System DSN tab.Click on the Add button.

Click on the Selection "Microsoft Access Drive (*.MDB) 3.50.360200..."

and press the Finish button.

The "ODBC Microsoft Access 97 Setup" window will appear.

Type in the "Data Source Name" text box IDCsample , then click on the select button.

The "Select Database" window will open. Find the database "IDCtest.mdb" select it and click the OK button.

Click OK to finish the DSN. The "ODBC Data Source Administrator" window will again open. Click OK to finish the DSN setup.

 

Create an executable Folder in FrontPage

Now open FrontPage and either create a new site or use a site you already have.

In FrontPage Create a Folder called "Run_Files". After the folder is created right click on the folder and select "Properties" from the pop-up window. The "Run_Files Properties" window will open.

Click on the check box "Allow scripts or programs to be run" so that it is checked.

Click OK to finish.

 

Create the HTX file

In FrontPage97 Explorer, click on | Tools | Show FrontPage Editor | to open the editor.

From the top menu, select | File | New | ...... "Database Results" and press the OK button.

A blank page (with a comment describing the page) will open. Move the cursor as far down as it will go. Press <Enter> twice to move down a bit more.

Select | Edit | Database | Detail Section |

The two L shaped symbols (brackets) will appear. These are the markers which define where the database fields should be placed. All fields are placed within these markers.

Move the cursor so it is placed exactly between the two red brackets.

From the top menu select | Edit | Database | Database Column Value |

The "Database Column Name" window will open. In the text box "Database column name" enter the word Name and press the OK button.

From the top menu select | Edit | Database | Database Column Value |

The "Database Column Name" window will open. In the text box "Database column name" enter the word Misc and press the OK button.

This will place the two fields Name and Misc on the database results window so that whatever data is in those fields will be displayed.

From the top menu select | File | Save As | , the Save As window will open

In the Page Title text box enter : IDCshowAllResults
In the "File Path...." text box enter: Run_Files/IDCshowAllResults.htx

Press the OK button to finish.

The results page is now ready.

 

Create the IDC file

From the Top Menu of FrontPage Explorer, select | File | New | ....highlight the "Database Connector Wizard" and click the OK button.

The "Internet Database Connector Wizard window will open.

Type IDCsample in the "ODBC data source:" text box

Type IDCshowAllResults.htx in the "Query results template:" text box ( or use the browse button to select this file).

Press the Next button to continue

Type "select IDnumber, Name, Misc from TestTable" in the text box

...and press the Finish button.

The IDC is now complete. This particular IDC will retrieve ALL records whenever it is called.

Create the HTM page which will start the query and show the results

Create a new page in the FrontPage Editor or use the index.htm page (or another page if you want).

Type the words "Show me all the records". Highlight these words and from the top menu select | Insert | Hyperlink |

The Create Hyperlink window will open. Click on the "Current FrontPage Web" tab on the top of the window. Next, click on the Browse button. The "Current Web" window will open.

Double click on the "Run_Files" folder to open it. The files in that folder will be shown. Select the file "IDCselectAll.idc" and press the OK button.

The Create HyperLink window will again be shown.

(If you like, instead of using the browse button you can just type in the text "Run_Files/IDCselectAll.idc" as shown above in the "Page" textbox.

Close all your FrontPage Editor pages (and save them if you have to).

At this point you are done. Make sure you have some data in the database table.

Open a browser and then go to the page where the link was placed. Most likely the Index.htm (if you followed the above instructions).

When the page opens you should see the link "Show me all the records". When you click on that link, the IDC should execute and the results page should load with the data on it.

 

This is only the first of many more tutorials on IDC so stay tuned.

Don't hesitate to give feedback, good or bad regarding this page. Either email the webmaster (bottom of page) or leave a message in the Guest Book which is located on the home page (see top right corner of this page).

On the next tutorial, a new IDC is added and to the web. A new form with a text box and a submit button are also added to allow you to place a value in the text box and have the computer return only the records that match the inputed value.

The "IDC Example2: Show Selected Database Records" page

 

Links

 

 


 

You are at the www.techadvice.com site which is not associated with the company or products shown on this page.
Contact Us,
Disclaimer
Advertisers
, ExoticRecipes
 

---