[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 277
  • Last Modified:

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

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
csm
Asked:
csm
  • 22
  • 17
1 Solution
 
MasseyMCommented:
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
 
csmAuthor Commented:
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
 
csmAuthor Commented:
massey you there????
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
MasseyMCommented:
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
 
csmAuthor Commented:
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
 
csmAuthor Commented:
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
 
MasseyMCommented:
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
 
csmAuthor Commented:
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
 
MasseyMCommented:
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
 
csmAuthor Commented:
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
 
MasseyMCommented:
masseym@javanet.com

Include them as attachments if possible.
0
 
csmAuthor Commented:
massy? did you get them okay??
0
 
MasseyMCommented:
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
 
csmAuthor Commented:
did you get the files?
0
 
MasseyMCommented:
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
 
csmAuthor Commented:
woaaa... sorry..yes i do..frostbite@koyote.com
0
 
MasseyMCommented:
Ok, I just sent them to you.

Later.

Again... If you have anything else? please let me know.
0
 
csmAuthor Commented:
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
 
csmAuthor Commented:
Adjusted points to 200
0
 
MasseyMCommented:
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
 
csmAuthor Commented:
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
 
MasseyMCommented:
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
 
csmAuthor Commented:
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
 
csmAuthor Commented:
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
 
MasseyMCommented:
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
 
csmAuthor Commented:
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
 
MasseyMCommented:
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
 
csmAuthor Commented:
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
 
MasseyMCommented:
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
 
csmAuthor Commented:
cool thanks...i got some extra time ... until tuesday..thanks for the help:)
0
 
csmAuthor Commented:
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
 
MasseyMCommented:
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
 
csmAuthor Commented:
hey bud how is it going??
0
 
MasseyMCommented:
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
 
csmAuthor Commented:
oh...i was?...okay...but ihave to have it done by tonight:)
0
 
csmAuthor Commented:
i only have to present it for about 10mins:)
0
 
MasseyMCommented:
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
 
MasseyMCommented:
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
 
csmAuthor Commented:
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 22
  • 17
Tackle projects and never again get stuck behind a technical roadblock.
Join Now