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

New to ASP and could use help and advice. 2

Status
Not open for further replies.

garymgordon

Programmer
Apr 5, 2000
307
US
I apologize up front for my lack of knowledge, but I could really use some help.

Here is the situation.

I have an html page.

I need to import data from various cells that is currently running on one of our Windows NT or 2000 servers in either ACCESS or EXCEL.

Then, I need to be able to format that information in a table - within the html page.

For example:

Here's what I'll need.

Name: John Smith
Address: 111 Main Street
City: West Orchard Township
State: NY
Zip: 12110

So, I'll need to import the field names as shown on the left, plus the values from the fields on the right that coorespond to the field names.

QUESTIONS:

1) Can this be done is ASP?
2) If so, ... (and I hate to ask this) .. but how?
3) If it can't be done in ASP, ... what do you recommend.

HELP ... PLEASE.

Thanks,
Gary
Gary M. Gordon, LLC
webmaster@garymgordon.com
Certified Web Developer ::
Application Programmer
 

for some good tutorials on how to connect to databases, retrieve data, etc.

and for the best quick ref guides on the net.

penny.gif
penny.gif
 
link9,

Would I be imposing to much upon you if I requested your help with the following. Here is what I could use at the moment.

1) If it is not too difficult, since I don't know what would be involved ...

If you could take a simple HTML page. Add the necessary ASP script that would connect to an access database, request data from a specific field (or group of specific fields) and place the output from those fields back into the html page.

2) Comment the script to show me what you did, how the script is working and how I could modify the asp portion of the code.

Would this be possible or am I requesting to much help from you?

Thanks,
Gary
:))

(I'd greatly appreciate it.)

Gary M. Gordon, LLC
webmaster@garymgordon.com
Certified Web Developer ::
Application Programmer
 
Here is my examples....

db_Connect.asp

<%
Set Connection = Server.CreateObject( &quot;ADODB.Connection&quot; )
Connection.Open &quot;Provider=SQLOLEDB.1;Persist Security Info=True;User ID=sa;Initial Catalog=AAC;Data Source=JONNY&quot;
%>

somefile.asp

<%@ Language=VBScript %>
<!--#include file=&quot;db_Connection.asp&quot;-->
<%
Const adOpenStatic = 3
Const adUseClient = 3
Const adLockPessimistic = 2

set rs=server.CreateObject(&quot;ADODB.Recordset&quot;)

sub ExecuteSQL(byval cmd)
if rs.State=1 then rs.Close
rs.CursorType = adOpenStatic
rs.CursorLocation = adUseClient
rs.LockType = adLockPessimistic
rs.Source = cmd
rs.ActiveConnection = Connection 'The record set needs to know what connection to use.
rs.Open
end sub
%>
<HTML>
<BODY bgColor=white>
<%
sql=&quot;Select * from MyTable&quot;
ExecuteSQL(sql)
while not rs.Eof
%>
<br>
<%=rs(&quot;FieldName1&quot;)%>
<%=rs(&quot;FieldName2&quot;)%>
<%=rs(&quot;FieldName3&quot;)%>
<br>
<%
rs.movenext
wend
%>
</body>
</html>

hope this helps u if u need more help please email me at
shaddow11_ro@yahoo.com ________

George
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top