Forum Moderators: open

Message Too Old, No Replies

Some help on ASP pages with MS Access DB backend pls

         

georgei

3:30 pm on Sep 26, 2003 (gmt 0)

10+ Year Member



Hi.. I really need your help on this one guys..

I need to create an ASP page with a MS Access ( don't ask =\ ) backend database..
I basically need to fill the database with various info and then display it out in tables on an HTML page
It has to be a DNS-less connection to the database (db will reside local to the ASP pages)

A table will 7 colums with Date create, user posted, rank#, etc... at the top, then a Subject row.. and then a Description below that.

I also need to build an Admin web interfact with several admin ids/passwords that will be able to Add/Edit/Remove new data..
This whole site can be very simple as long as it works

Now a little about my experience.. I'm not a developer or programmer.. i'm a designer..
But, i've been using PHP/Perl scripts for a long time with MySQL backend..
I can install them, modify to my needs, and run on windows/*nix servers.. run mysql queries, etc..

But i've never used asp or even created an ms access db before..

Tried searching on the web for tutorials and reading a big fat book on creating websites with db's, but it wasn't that great.. no examples, just overviews

So, i'm asking for any help I can get.. even if it's just a link on some peace of info that'll help me

Thank you in Advance

skipfactor

3:41 pm on Sep 26, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi, welcome to WW,

Dreamweaver Ultradev or Dreamweaver MX is in my opinion, the easiest way to author for ASP/Access. Set up your DSNless & point-&-click your way through most of what you need to do.

With your PHP background, and DW's point-&-click insertion of VBscript, you'll feel comfortable massaging script in code view in a few days.

mattglet

4:09 pm on Sep 26, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



if the above recommendation doesn't work for you, i suggest you do this:

break your task down into pieces. then look up a tutorial on the internet for each task. being an asp developer, i almost guarantee you can find a tutorial about every step you get to in your project.

i.e.

-Creating a DSN-less connection with ASP
-Retrieving records from an Access Database with ASP
-Displaying records on a webpage with ASP

... and so on.

-Matt

georgei

6:16 pm on Sep 26, 2003 (gmt 0)

10+ Year Member



Thank you skipfactor.. i tried doing that in DW, but i can't even make a dsn-less connection.. i tried various strings.. and this one works for me if i just manually make the connection in the code:

'Access connection code
DataConn.Open "DBQ=" & Server.MapPath("newdb.mdb") & ";Driver={Microsoft Access Driver (*.mdb)};DriverId=25;MaxBufferSize=8192;Threads=20;", "username", "password"

Any tips on that?

Also, thanks for the suggestions mattglet.. that's basically what i'm trying to do at this time.. going through all the examples, i've got a working copy now, trying trying to modify it to my needs.. having some issues.. hopefully a matter of time.

And defanjos, thanks for the link.. it looks excellent.. i'm defenatly going to go through that site see what i can dig up :)

skipfactor

7:08 pm on Sep 26, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



from the Dreamweaver MX help files:

Creating a DSN-less connection
You can use a DSN-less connection to create an ODBC or OLE DB connection between your web application and your database.

You use a connection string to create the connection. A connection string combines all the information your web application needs on the server to connect to a database. Dreamweaver inserts this string in your page’s server-side scripts for later processing by your application server.

Here’s an example of a connection string:

Driver={Microsoft Access Driver (*.mdb)};
DBQ=C:\Inetpub\wwwroot\Academy\curriculum.mdb

georgei

10:54 pm on Sep 26, 2003 (gmt 0)

10+ Year Member



Thanks skipfactor, that works for DW :)

I got an Access DB up and running and an ASP page pulling data to the web from it.. i have each row going to a separate table and some sorting options..

All the Tables are showing all of my fields, including the ID field.. 1 - 10.. how do I hide this column from showing up on the web?

Also, my first field is an Icon field.. for icons like New, Update, Hot topic, etc.. can I hide just the NAME of that column at the top?

Thanks again!

skipfactor

11:46 pm on Sep 26, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



In DW MX, create a one row table with x columns. On the right panel: 'Application' tab, 'Bindings', expand your recordset, & drag-drop just cols you want displayed.

Select all cells & insert a repeat region ('Application' tab, 'Server Behaviors', 'Repeat Region') for how many records you want displayed.

davegerard

4:06 am on Sep 27, 2003 (gmt 0)

10+ Year Member



Here a recordset example for you ASP/Access page.

<%
db = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=whatever.mdb"

set rs = server.createobject("adodb.recordset")
sql = "select * from table"
sql = sql & " where Field1 = '" & Value1 & "'"
rs.open sql, db
if not rs.eof then
do while not rs.eof
response.write rs("field1") & "<br>"
response.write rs("field2") & "<br>"
response.write rs("field3") & "<br>"
rs.movenext
loop
end if
rs.close
set rs = nothing
%>

georgei

7:09 pm on Sep 27, 2003 (gmt 0)

10+ Year Member



This is turning out great, thanks A LOT guys :)

I'm trying to add a RecordSet in 'Application' tab, 'Bindings'.. I've created a site, chose document type, created test site, but that line doesn't have a check next to it, eventhough i did it.. i can expand my DB, see the table and all the fields in there..

but when i try to click + to add a recordset, it's grayed out.. any ideas?

skipfactor

4:48 am on Sep 28, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I've created a site, chose document type, created test site

but when i try to click + to add a recordset, it's grayed out.. any ideas?

MX bugginess. Ultradev let you create a recordset whenever, MX well...

I get around this by:
Right-clicking & "copy" -ing then "paste" -ing a recordset from an existing successful recordset/site/page into the greyed-out application recordset panel, then change the SQL statement by 2-clicking on the pasted recordset.

or if you don't have that:

Convince MX that you have the correct 'testing server' a bizillon times, then the greyed-out will automagically become active--seems like MX likes a remote testing server to hack out the grey '+' sign.

georgei

4:13 pm on Sep 28, 2003 (gmt 0)

10+ Year Member



Thank you again, that worked :)

RegTheDonk

6:39 pm on Oct 1, 2003 (gmt 0)

10+ Year Member



Bit late in replying, glad you got things sorted Georgei.

I've been using Ultradev for a couple of years now, find it a godsend using the wizzards to create the connections.

I find the easiest thing is to do all your work locally using Personal Web Server WITH a DNS connection. Once you've finished all your work and tested it on your localhost, just go into the HTML inspector and change the connection string eg:
----------------------------
MyRecordset.ActiveConnection = "DBQ=" & Server.Mappath("myaccess.mdb") & ";Driver={Microsoft Access Driver (*.mdb)};"
----------------------------
You should then be able to simply upload these pages to your web server.