Solved

asp database local ------> to isp

Posted on 1998-11-08
39
257 Views
Last Modified: 2013-12-25
i have a website with a database local at home. using pws. i need to ftp site to isp do i need to change loaction of database on the asp pages?
0
Comment
Question by:csm
  • 22
  • 17
39 Comments
 
LVL 10

Accepted Solution

by:
MasseyM earned 250 total points
ID: 1856207
You will need to know the physical path to the database... In addition, you will need ot have the isp establish the DSN for you.  Obviously they must be running an NT service and that should be included within your ISP charges...  If they will not set you up with a DSN, you can create your own everytime someone need to access the database... If you wish, I will show you how...

0
 

Author Comment

by:csm
ID: 1856208
my isp said they can run asp pages..but i think they use apache webserver, or somekind of linux software...

for the pys. address would it be...www.server.com/some/database
?
0
 

Author Comment

by:csm
ID: 1856209
massey you there????
0
 
LVL 10

Expert Comment

by:MasseyM
ID: 1856210
Sorry took so long... Busy these days.

If your ASP can do ASP, you just need to ask them to set up a DSN for you.  You can thern, withing your ASP page, hook up to it via the Connection object.  You would just need to tell the ISP where you putthe DB.
0
 

Author Comment

by:csm
ID: 1856211
thks but they have now decided not to support my asp and database..but i have another proivder on a local netword running nt......so go ahead with the nt option....

 the computer will be on am intranet nt server
0
 

Author Comment

by:csm
ID: 1856212
but if i can use asp with help of isp please tell me that way first..i would prefer to use the internet server, instead of the intranet server
0
 
LVL 10

Expert Comment

by:MasseyM
ID: 1856213
OK, here is the way to set up your own DSN...

DSNSpecs.dsn
-----------------------------
[ODBC]
DRIVER=Microsoft Access Driver (*.mdb)
UID=admin
UserCommitSync=Yes
Threads=3
SafeTransactions=0
PageTimeout=5
MaxScanRows=8
MaxBufferSize=512
ImplicitCommitSync=Yes
FIL=MS Access
DriverId=25

DSNInc.asp
-------------------------------
<%
  Dim sDB, sPath, sDSNDir, sDSNFil, sDefDir, sDSN, sScriptDir

  sDB   = "YourDB.mdb" ' Your database name

  sScriptDir = "/VirtualPath/" ' Virtual Path To Script

  ' Set the virtual Directory
  sPath = Server.MapPath(sScriptDir) & "\"

  ' This is the resulting DSN string
  sDSN = "filedsn=" & sPath & "DSNSpecs.Dsn;DefaultDir=" & sPath & ";DBQ=" & sPath & sDB & ";"
%>

sample.asp
-------------------------------------------
<% Server.ScriptTimeOut = 15 %>
<!-- #include Virtual="/DSNInc.Asp" --> <!--Make sure the path is correct -->
<%
      Set Conn = Server.CreateObject("ADODB.Connection")
      Conn.Open sDSN      ' This is the connection string from DSNInc.asp
      sql="SELECT * FROM Table"
      Set rs = Server.CreateObject("ADODB.Recordset")
      rs.Open sql, conn, 3, 3
      NumQuotes = RS.RecordCount
      rs.Close
      set rs=nothing
%>

Do the DB stuff here.

<%
rs.close
conn.close
set rs = nothing
set conn = nothing
%>


If you need more help, let me see your script and DB.

0
 

Author Comment

by:csm
ID: 1856214
cool i have added my system dns on my local pc runnimg pws...
the asp pages look fine now...
if i to transfer the entire collection to either isp server or intranet server how would i do that?
i have ftp program, and have sent pages to isp....but have not sent asp pages there yet thanks:)
0
 
LVL 10

Expert Comment

by:MasseyM
ID: 1856215
Send them the same way.  Just make sure that everything is in the same place... ie that the directory structure is the same.  The comment from above about the DSN will work on the internet server as well.  Good luck.

Again, if you need more hlp,just ask...
0
 

Author Comment

by:csm
ID: 1856216
cool thks, if you dont' mind post your email, and i will send you the asp files...i am using a freeware asp generater so i am not too sure how to edit the file to add the include file in it...and what is the virtual path
0
 
LVL 10

Expert Comment

by:MasseyM
ID: 1856217
masseym@javanet.com

Include them as attachments if possible.
0
 

Author Comment

by:csm
ID: 1856218
massy? did you get them okay??
0
 
LVL 10

Expert Comment

by:MasseyM
ID: 1856219
Yes,  I sent the reply back to you.  Did you not receive it?  I will see if I still have the files.  If not, could you sent them again.

0
 

Author Comment

by:csm
ID: 1856220
did you get the files?
0
 
LVL 10

Expert Comment

by:MasseyM
ID: 1856221
I received them and then sent them back.  I keep geting send errors whenever I try to reply to your email address.  What is it?  

I have:
frostbite@collegeclub.com

Is this correct?   Do you have another address?
0
 

Author Comment

by:csm
ID: 1856222
woaaa... sorry..yes i do..frostbite@koyote.com
0
 
LVL 10

Expert Comment

by:MasseyM
ID: 1856223
Ok, I just sent them to you.

Later.

Again... If you have anything else? please let me know.
0
 

Author Comment

by:csm
ID: 1856224
hey dude don't worry about the files and stuff...i found some freeware..and books to help...
.
i just need some help with a table thing...i need to put in a field at the end of each record on the page only for amt to order...the hit order and sends the amt to order.asp...

sorry about the emial stuff...i have everything else working....if you can get this to me asap..like wensday earlier..i would appreciate it...class presentation on thursday:)
and i still have to change code to run on school server...i will jack the points up..for your patients thanks

here is a sample of code
i get the error in the response.write..the last table field i try to enter...i have inv number a primary key field..and i was either going to use it or make up one with the hand..int combo thanks

<%

Option Explicit

'-------------------------------------------
'---- Generated by the ASP Table Wizard ----
'---- http://www.paulsimmons.com        ----
'-------------------------------------------

Dim sRowColor
Dim objDB
Dim objRS
Dim sDBName
dim int

'TODO: Verify database path...
sDBName = "driver={Microsoft Access Driver (*.mdb)};dbq=C:\WEBSHARE\WWWROOT\lunar\database\lunar.mdb"
Set objDB = Server.CreateObject("ADODB.Connection")
objDB.Open sDBName

'TODO: Modify the next line to only return the records you want...
Set objRS = objDB.Execute("select * from OS")

%>
<html>

<head>
<title>Operating Systems</title>
<meta name="GENERATOR" content="Microsoft FrontPage 3.0">
<meta name="Microsoft Border" content="tl, default">
</head>

<body background="images/backblue.jpg">

<p align="center">&nbsp;</p>

<form METHOD="post" ACTION="order.asp">
  <div align="center"><center><p><font color="#FFFFFF"><big><big>Operating Systems</big></big></font>
<%



If objRS.EOF Then
      Response.Write("<b>No matching records found.</b>")
      objRS.Close
      objDB.Close
      Set objRS = Nothing
      Set objDB = Nothing
      Response.End
End If
response.write("<center>")
Response.Write("<table border=0 cellpadding=2 cellspacing=2>")
Response.Write("<tr bgcolor=silver>")

'COOL TIP: the <filter> tag is used by Excel 97
'if your users save this file from the browser and open it in XL 97, XL will
'parse all the table cells into XL ranges and turn on filtering...

response.write("<th filter=ALL>Inv Number</th>")
Response.Write("<th filter=ALL>Manufactor</th>")
Response.Write("<th filter=ALL>Product Name</th>")
Response.Write("<th filter=ALL>Price</th>")
Response.Write("<th filter=ALL>Qty On Hand</th>")
response.write("<th filter=ALL>Qty Order</th>")
Response.Write("</tr>")

int= 1

Do While Not objRS.EOF
      Response.Write("<tr bgcolor=" & sRowColor & ">")
      response.write("<td>" & objRS("Inv Number") & "</td>")
      Response.Write("<td>" & objRS("Manufactor") & "</td>")
      Response.Write("<td>" & objRS("Product Name") & "</td>")
      Response.Write("<td align=right>" & objRS("Price") & "</td>")
      Response.Write("<td align=right>" & objRS("Qty On Hand") & "</td>")
      response.write("<input type="text" name = hand(int) >")
      Response.Write("</tr>")
      objRS.MoveNext
Loop

Response.Write("</table>")


objRS.Close
objDB.Close
Set objRS = Nothing
Set objDB = Nothing

%>  </p>
  </center></div>
</form>
</body>
</html>

0
 

Author Comment

by:csm
ID: 1856225
Adjusted points to 200
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 10

Expert Comment

by:MasseyM
ID: 1856226
Your problem lies here:

response.write("<input type="text" name = hand(int) >")

Use this instead:

response.write "<input type='text' name= " & hand(int) & ">"

the "'s around text was screwing up the output.  Also, the hand(int) was not going to be put in the value field.


0
 

Author Comment

by:csm
ID: 1856227
cool...how do i get it to align witht the table? all of the boxes are before the table..although the response.write is inside the scripts...?
0
 
LVL 10

Expert Comment

by:MasseyM
ID: 1856228
do this:

Response.Write "<TD ALIGN='center'><INPUT TYPE='text' NAME=" & hand(int) & "></TD>"

That will place it in the last column of the table.
0
 

Author Comment

by:csm
ID: 1856229
i am getting a type mismatch....i have hand,int both just dim...
the unique id for each item is like hand1,hand2...

so when the person puts in a number in theis box...hits order..i am trying to send it to orders.asp...i have 8pages...that all will send to order.asp..the order.asp will be like a po on the screen...

so i just put hand in there..and int...with a counter?
i tried it..and for loop nothing has worked ?:) how much longer you going to be online?
0
 

Author Comment

by:csm
ID: 1856230
i am getting a type mismatch....i have hand,int both just dim...
the unique id for each item is like hand1,hand2...

so when the person puts in a number in theis box...hits order..i am trying to send it to orders.asp...i have 8pages...that all will send to order.asp..the order.asp will be like a po on the screen...

so i just put hand in there..and int...with a counter?
i tried it..and for loop nothing has worked ?:) how much longer you going to be online?
0
 
LVL 10

Expert Comment

by:MasseyM
ID: 1856231
Can you zip up the 8 pages and your order.asp and send them to me?  masseym@javanet.com  I am going to go to work right now, but I will work on them during my break.


Later,

Matt
0
 

Author Comment

by:csm
ID: 1856232
COOOOOOOOOOOOOLLLLLLLL!!!!!!
I CHANGE the hand(int) to the inv number one...since it is unique..and i can try and use it to send to order.asp...

you going to be on latter? i have been up for 24hrs straight....

all i need to do is put in the form header...action=order.asp..
and a submit button?

then in order.asp...say something like...

if request.os." & field name from os page &" > 0
 response.write You have ordered "& field name from os page&" price....

will this work for each page?
so i can get a total po done?
0
 
LVL 10

Expert Comment

by:MasseyM
ID: 1856233
basically... But you need to let them add and remove stuff as well... This is pretty simple.  As soon as I get the database I will play around with it.   I must have lost it.  Sorry..


0
 

Author Comment

by:csm
ID: 1856234
dude...thaks for the help...if you are online thurs morning...or late wensday night post something plz!!!...i have to transfer files around 6 or 7 thurs morning...thaks
0
 
LVL 10

Expert Comment

by:MasseyM
ID: 1856235
Due to work schedules, I would eb on again until tonight.  I am just got off a 24hr shift... I am going back now (aft 6 hrs sleep for another 8... I will email when I am done.


0
 

Author Comment

by:csm
ID: 1856236
cool thanks...i got some extra time ... until tuesday..thanks for the help:)
0
 

Author Comment

by:csm
ID: 1856237
it seems like alot is working...just the dynamic naming of the last field in table is not going into the order.asp page:)
0
 
LVL 10

Expert Comment

by:MasseyM
ID: 1856238
Hey csm,

I don't see any boxes on any pages.. Did you send me the most recent ones?  I am working on a solution right now however.

0
 

Author Comment

by:csm
ID: 1856239
hey bud how is it going??
0
 
LVL 10

Expert Comment

by:MasseyM
ID: 1856240
Pretty well.. Did you receive my last email?  I am rewriting the stuff from scratch.  You were doing so many different DB calls, that it would crash the system after 1 hour or so... More to follow.
0
 

Author Comment

by:csm
ID: 1856241
oh...i was?...okay...but ihave to have it done by tonight:)
0
 

Author Comment

by:csm
ID: 1856242
i only have to present it for about 10mins:)
0
 
LVL 10

Expert Comment

by:MasseyM
ID: 1856243
OK, I have today off, so I will work and get it done.  Please post a good email address that I can send the attachments to.


0
 
LVL 10

Expert Comment

by:MasseyM
ID: 1856244
Ok, I am sending the stuff to you right now.  However, I have a few suggestions.

1) redesign your database.  You should have each table EXACTLY the same in structure for ordering ease.
2) Have a central order page (What I did via the order.asp page).  
3) The one I am sending you does not allow for more than one "section" to be ordered from.  You will have to add functionality to it to make it remember each item previouosly ordered.
0
 

Author Comment

by:csm
ID: 1856245
cool...it work pretty well...i will try to modify it to put the item ordered into a database...then when they are done call all from database with the customer id...
or session id. thanks for the help


0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Both Easy and Powerful How easy is PHP? http://lmgtfy.com?q=how+easy+is+php (http://lmgtfy.com?q=how+easy+is+php)  Very easy.  It has been described as "a programming language even my grandmother can use." How powerful is PHP?  http://en.wikiped…
Why do we like using grid based layouts in website design? Let's look at the live examples of websites and compare them to grid based WordPress themes.
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…
The viewer will get a basic understanding of what section 508 compliance can entail, learn about skip navigation links, alt text, transcripts, and font size controls.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now