Jump to content

Splurd

Members
  • Posts

    60
  • Joined

  • Last visited

Posts posted by Splurd

  1. I cannot use servers because this is being burn on a CD to be passed to customers.I dont need to write to the database, only to read from it.The database contains a catalague of products. I need to make a webpage, that can read from this database and display the data. And all of this should be on a CD so its portable and no internet access is needed.

  2. I have a database. (whoopie)I have a cd. (whoopie)I have to get some way to get data from the database when its burnt onto a CD. (o crap)I have no idea how to do this, so was thinking if it was possible to do it via javascript. Or any other language. Or any easy method.

  3. Running your own server requires a static ip address which you do not get with residential internet service. Also you should have high speed internet if you are going to host.
    I have a static IP address. (which irks me to no end) And the speed here is not an issue, My main goal is to get a website up and running, with as little cost as possible. (aka no cost)Didnt think my humble thread would generate a heated discussion about hosting and servers and uh, drinking habbits. ;p But to be truthful I dont think I will be in need of such a secure system.I knew of a guy who set up his webpage from his home pc, using windows and using ISS. Thats kinda what I am aiming for. Though I would consider getting a hosting service because its more efficent, I still am curious as to how to host on a home pc.
  4. Most of the time, I've been using either my collage servers or my the server at my workplace to host my files and do my stuff. But all of those were already set up and I basicly just ftp over and run it. I have very little knowlage of networking and such.Anyway, my parents want their lovely little IT wiz kid to make them a website, and I am not very sure of how to host it. Whilst I am aware of sites that offer hosting services, I was thinking of using my PC at home to be my server and host the site since it is basily on 24/7.So can anyone point to me a guide on how to host a website using your own computer as a server? And getting domain names etc.

  5. Well lets say you have a database, I use microsoft access, and you can select to import data from an excel file. And put the data from the excel file into the database in a table.was wondering if it was possible to make a script such that, when a person uploads a excel file, it will automaticly covert it and add the data from the excel file into the database.

  6. I'm having trouble with my update db page, and so I've included the code.The table I have, has some values as numbers and some as String, I'm not 100% sure if that is causing the problem.

    Microsoft OLE DB Provider for ODBC Drivers error '80040e21'Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done./TestDB/Version4/update_entry.asp, line 49
    ^^^This is the error that I am getting
    <%'Dimension variablesDim adoCon    'Holds the Database Connection ObjectDim rsUpdateEntry  'Holds the recordset for the record to be updatedDim strSQL 	 'Holds the SQL query for the databaseDim lngRecordNo 	 'Holds the record number to be updatedDim Primekey 	 'Holds the primarykey nameDim keyno    'Holds the primarykey value,  must be numberDim table1   	 'table name,'Read in the record number to be updatedtable1 = Request.Form("table1")if table1 = "sg_test" OR table1 = "False_tb" then 	primekey = "SN"elseif  table1="Contact_tb" OR table1 ="User_tb" then	primekey = "Account_ID"elseif  table1="Warrenty2_tb"  Or table1="Warrenty_tb" then	primekey = "ID"end ifkeyno =  Request.Form("keyno")'Create an ADO connection odjectSet adoCon = Server.CreateObject("ADODB.Connection")'Set an active connection to the Connection object using a DSN-less connectionadoCon.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("db1.mdb")'Create an ADO recordset objectSet rsUpdateEntry = Server.CreateObject("ADODB.Recordset")'Initialise the strSQL variable with an SQL statement to query the databasestrSQL = "SELECT " & table1 & ".* FROM " & table1 & " WHERE " & primekey & "=" & keyno'strSQL = "SELECT sg_test.* FROM sg_test WHERE SN ='" & Request.Form("ID_no") & "'"response.Write(strSQL & "<br>" )'Set the cursor type we are using so we can navigate through the recordsetrsUpdateEntry.CursorType = 2'Set the lock type so that the record is locked by ADO when it is updatedrsUpdateEntry.LockType = 3'Open the tblComments table using the SQL query held in the strSQL varaiablersUpdateEntry.Open strSQL, adoCon'Update the record in the recordset'rsUpdateEntry.Fields("CONTACT_NO") = Request.Form("CONTACT_NO")	  for each x in rsUpdateEntry.Fields       rsUpdateEntry.Fields(Cstr(x.name)) = Request.Form(x.name)    next'Write the updated recordset to the databasersUpdateEntry.Update'Reset server objectsrsUpdateEntry.CloseSet rsUpdateEntry = NothingSet adoCon = Nothing'Return to the update select page incase another record needs deletingResponse.Redirect "update_select.asp"%>

    ^^^This is my code.Any views on this?

  7. are both form's elements available in the POST array? I can see the need for more than one form on a page but what is the point of submitting 2 forms at once? Why not make it one form?

    because I am going to put id="ect" in the 2nd form to do JS with it, and if I combine the form it makes things somewhat complicated for me, so I was wondering it there was a way to do it. Plus it cant hurt to know if it can be done.I tried scott100's method but it only sumbited the 2nd form. Its weird tho, I put an alert in the script and it processed the first form but not the second. But if I remove the aleart, It will process the 2nd form.(eg, form1.submitalert("hoho")form2.submit)returns the first one. scott100's target thing seems to work, but I think thats besause the forum is submited twice to the pages. eg, form1 gets sumbited to the page, then form2 gets sumbited to another instance of the page. As opposed to form1 and form2 get submited to the page at the same time.
  8. Can it be done? basicly I have one form, but since I am doing some JS thing, I want to split it up into two forms.Like,

    <form action="sectest2.asp" method="post"><input type="text" name="haha"><br></form><form  action="sectest2.asp" method="post"><input type="text" name="hehe"><br><input type="submit" name="wow" value="Da submit buttan"><br></form>

  9. I was using firefox and it didnt work. I dont know why, anyway I made one that worked

    <html><head><script type="text/javascript">function addbox(){var x=document.getElementById('haha')//divvar y=document.getElementById('warnety')//formvar i=0for (i=0;i<(y.length-2);i++)	{	z+="tb1<input type='text' name='tb1' value=" + y.elements[i].value + "><br>"	i++	z+="tb2<input type='text' name='tb2' value=" + y.elements[i].value + "><br><hr>"	}x.innerHTML= z +"tb1<input type='text' name='tb1'><br>tb2<input type='text' name='tb2'><br>"}</script><title>test start</title></head><body bgcolor="white" text="black"><form ID="warnety"action="test2.asp" method="post"><div id="haha">tb1<input type="text" name="tb1"><br>tb2<input type="text" name="tb2"><br></div><input type="button" onClick="addbox()" value="Clickzor"><input type="submit" value="de submit buttan"></form><br></body></html>

    Loops thru the form, puts the values in z, then pastes z + 2 new textboxes out.:)

  10. uh, its like, you type in something, hit the button to add boxes, but it wipes out what you previously typed.after a moment of thought, In order to make it work, I have to loop thru the textboxes, get their value, and somehow get it print out the value inside the text boxes.

  11. <html><head><script type="text/javascript">function addbox(){var x=document.getElementById('haha')x.innerHTML+="<hr>tb1<input type='text' name='tb1'><br>tb2<input type='text' name='tb2'><br>"}</script><title>test start</title></head><body bgcolor="white" text="black"><form action="test2.asp" method="post"><div id="haha">tb1<input type="text" name="tb1"><br>tb2<input type="text" name="tb2"><br></div><input type="button" onClick="addbox()" value="Clickzor"><input type="submit" value="lol"></form><br>content here!</body></html>

    Yeah. Wonderful code. Works. Cept that every time I click the button to add more boxes, it blanks out the previous boxes.Am I doing it incorrectly? I'm new to the javascript thing. (######, still pretty new to most things too)

  12. I'm new to vbscript and I'm doing asp,anyway I read the tutroials and I sorta understood them, but I am not sure how to do what I want.Basicly, I want to create a function, which will return a value depending on what I do.Like, for example comparing value

    Function compare(valuehere)if valuehere = "yes" OR valuehere = "y" OR valuehere = "true" OR valuehere = 1 then   ans = trueelse   ans = falseend ifEnd Function

    so how do I get ans out, can someone show me an example?

  13. but where would I put it?Also, query sting is convient due to it being in a link form. The only other link form would be using a report, but that ends up as a button.I could do it by session or cookies, but I would need some tirgger to set the varibles in the session / cookies. So if the person clicks on link A, it will know its looking for table A, and when the person clickso n table B, it will know its looking for table B etc.

  14. whilst that seems very secure and nice, I would rather something alot more simplier and wont change my url to be 5 pages long :)Is there a simplier one? I'm not saying the complex one is bad, I just prefer a simplier one

  15. You can use commands like CONVERT or CAST for string to integer conversion....http://www.experts-exchange.com/Databases/Q_20646601.html

    This requires me to register and pay money.The logic of the page is like this,
    <form  method="post" action="displaytb2.asp"><input name="table" type="hidden" value="Warrenty2_tb" >Select an option<select name="option">	<option value="all" selected >View All Warrenties</option>	<option value="search">Search</option></select><br>Conditions for search:<br>Look in :<select name="field">	<option value='NA' selected>-Select one-</option>	<option value="Warrenty_ID" >Warrenty No</option>	<option value="UF_id" >UF id</option>	<option value="Cus_nam" >Customer name</option>	<option value="Cus_age" >Customer age</option>	<option value="Cus_contact" >Customer Contact number</option>	<option value="Cus_email" >Customer Email</option>	<option value="Cartridge" >Cartridge</option>	<option value="Weight" >Weight</option></select><select name="cond">	<option value=' = ' selected>Equals to</option>	<option value=' <> '>Not equals</option>	<option value=' > '>Greater than</option>	<option value=' < '>Less than</option>	<option value=' LIKE '>Search</option></select>Search for :<input name="searchvar" type="text" value="Enter Seach value here"><br><input type="submit" value="hahahah"></form>

    Then in the displaytb2.asp

    if Request.Form("option") = "all" then 	T_SQL = "SELECT * FROM " & Request.Form("table")elseif Request.Form("option") = "search" then	T_SQL = "SELECT * FROM " & Request.Form("table") & " WHERE " & Request.Form("table") & "." & Request.Form("field") & Request.Form("cond")	if Request.Form("cond") = " LIKE " then T_SQL = T_SQL & "'%" & Request.Form("searchvar") & "%'"	else T_SQL = T_SQL & "'" & Request.Form("searchvar") & "'" end ifend if

    This works fine if all my values are text, but if they are numbers, it gets the error.

  16. Anyway, I have a problem, and for reference I am using asp.I have a database(duh) and I am selecting values from it using a sorta dynamic table, Instead of making a page to display data for all the diffrent tables / sitautions etc, I made a table which takes in values from forms and displays data.The problem is, my condition statement. I have some statements which are string, and some which are numbers, so the quotation marks screw me up.And I cant check if the value can be converted to string, because I have some values in the DB which are all numbers, but stored as text. (they want the 0005 look.)Any advice?

  17. Right now, I currently put my table and conditions in the querystring and I know thats really unsecure.Is there anyway to make it more secure? So is there a way, to maybe function to encript and decript it, with out too much hassle? I'm not looking for reallllly super secure things, just want something that doesnt take 5 iq to abuse, so I dont get stuff like people selecting from the important tables

  18. Basicly I found two diffrent ways to do it, from browing the various tutorials.

    Set rsAddComments = Server.CreateObject("ADODB.Recordset")strSQL = "SELECT sg_test.* FROM sg_test;"rsAddComments.Open strSQL, adoCon, 3 , 3rsAddComments.AddNewrsAddComments.Fields("SN") = Request.Form("SN")rsAddComments.Fields("COUNTRY") = Request.Form("COUNTRY")	rsAddComments.Fields("MF_CODE") = Request.Form("MF_CODE")	rsAddComments.Fields("MF_NAME") = Request.Form("MF_NAME")	rsAddComments.Fields("ADDRESS") = Request.Form("ADDRESS")	rsAddComments.UpdatersAddComments.CloseSet rsAddComments = Nothing

    Then in the w3schools ado section there was this methodhttp://www.w3schools.com/ado/ado_update.aspSo whats the difference between the two and which is better /easier. For both adding a new record to a data base and editing/updating an existing record

  19. yeah, Basicly I just want to know the various ways to pass varibles thru pages.From what I know, we got, 1) forms, <form action="page2.asp"><input type="text" name="woo"></form>on page 2,Request.Form("woo")2)in the url,<a href=page2.asp?woo=Hello>page2</a>on page 2,Request.QueryString("woo")And thats all I know. Is there any other way to pass varibles thru? Or make a url pass varibles via a form. I dont want to use querystrings because I am passing the name of my table thru, and people might peek at the table with pw's. etc. Just curious on all the diffrent ways you know.

×
×
  • Create New...