william_stam 0 Junior Poster

only 100gb? i already have a 100gb hdrive i need atleast a 160. cool idea tho. full marks to hitachi

william_stam 0 Junior Poster

whooohooo. i have been a freelance asp developer for the past 4 years. i recently went to an interview for a job (need to gain a bit of "employment" experiance) the first question the interviewer asked was "straight after a recordset if this statement = true what does it meen? recordset = eof", i was totaly taken aback. he later explained that he has interviewed alot of people that couldnt even answer that question, and to think they were appling for a asp developers role (before you wonder, i do know the answer)

since i was a freelance developer i had to do the design part aswell, and i trully admire the designers. its not an easy job.

william_stam 0 Junior Poster

i had to do a similer project recently... found this bit of code and modified it a bit

Dim user_agent, mobile_browser, Regex, match, mobile_agents, mobile_ua, i, size

user_agent = Request.ServerVariables("HTTP_USER_AGENT")

mobile_browser = 0

Set Regex = New RegExp
With Regex
   .Pattern = "(up.browser|up.link|mmp|symbian|smartphone|midp|wap|phone|windows ce|pda|mobile|mini|palm|mobi)"
   .IgnoreCase = True
   .Global = True
End With

match = Regex.Test(user_agent)

If match Then mobile_browser = mobile_browser+1

If InStr(Request.ServerVariables("HTTP_ACCEPT"), "application/vnd.wap.xhtml+xml") Or Not IsEmpty(Request.ServerVariables("HTTP_X_PROFILE")) Or Not IsEmpty(Request.ServerVariables("HTTP_PROFILE")) Then
   mobile_browser = mobile_browser+1
end If

mobile_agents = Array("w3c ", "acs-", "alav", "alca", "amoi", "audi", "avan", "benq", "bird", "blac", "blaz", "brew", "cell", "cldc", "cmd-", "dang", "doco", "eric", "hipt", "inno", "ipaq", "java", "jigs", "kddi", "keji", "leno", "lg-c", "lg-d", "lg-g", "lge-", "maui", "maxo", "midp", "mits", "mmef", "mobi", "mot-", "moto", "mwbp", "nec-", "newt", "noki", "operamini", "palm", "pana", "pant", "phil", "play", "port", "prox", "qwap", "sage", "sams", "sany", "sch-", "sec-", "send", "seri", "sgh-", "shar", "sie-", "siem", "smal", "smar", "sony", "sph-", "symb", "t-mo", "teli", "tim-", "tosh", "tsm-", "upg1", "upsi", "vk-v", "voda", "wap-", "wapa", "wapi", "wapp", "wapr", "webc", "winw", "winw", "xda", "xda-", "opera mobi")
size = Ubound(mobile_agents)
mobile_ua = LCase(Left(user_agent, 4))

For i=0 To size
   If mobile_agents(i) = mobile_ua Then
      mobile_browser = mobile_browser+1
      Exit For
   End If
Next


If mobile_browser>0 Then
   response.write("mobile")
   else
   Response.Write("normal")
End If
william_stam 0 Junior Poster

you will need to probably use javascript for that..

alternatively... give your submit buttons diferent values and retrieve them on a "splitter" page..

request("sumbit1") etc :P

william_stam 0 Junior Poster

hi anyone know of a component that will make an image (preferably on the fly) of a pdf document.

for eg...

i upload a pdf file... it gets saved on the server.. when i view a record that the pdf document is attatched to... it generates a thumbnail of the pdf page. prob is... the pdfs that will be generated are rather complex and contain images / text etc

regards

william_stam 0 Junior Poster

you cant do it. sql is server side. javascript is client side. you need a way of interacting with the server. javascript doesnt do that.

william_stam 0 Junior Poster

there isnt a mysql version 2000. and that you would have to ask in the "database" forums

william_stam 0 Junior Poster

or just write a script that reads the records from access and the writes it to the other db.... i have to do it this way with mysql

william_stam 0 Junior Poster

do you have a database?

if so set up a command to update it. so you would have the article number. when the page is called a recordset retrieves the last value and then adds one. the command then updates the record to be the new value. you might want to use sessions though that it doesnt count EVERYTIME the same user views the page for that session. like a refresh of page.

the other way you could do it if your hosting server is stable is use application variables. which would reset if the server ever went down but is the easiest to use.

the other way is via a text file for each page. it reads the text file adds one then writes back to the text file the updated figure. not very practical as plenty text files get created then

william_stam 0 Junior Poster

the calendar / popup page

<%@ Language=VBScript %>
<%Option Explicit%>
<%
 Dim m_dtCurrentDate  'Currently selected date/time
 Dim m_lDayofFirst  'The day of the week that the first of the current month falls on
 Dim m_lDaysInMonth  'Number of days in the selected month
 Dim m_dtBegin   'Beginning date of the selected month
 Dim m_dtEnd    'Ending date of the selected month
 Dim m_lYear    'Currently selected Year
 Dim m_lMonth   'Currently selected Month
 Dim m_lDay    'Currently selected Day of the month
  
 Dim m_sInputName  'Name of the input field from the parent page
 Dim m_dtPassedInDate 
 
 m_sInputName = Request.QueryString("N")
 
 'Build the date/time from individual parts if there has been a post back.
 'Otherwise, just get the current date/time.
 If Request.QueryString("A") <> "" Then
  m_lYear = Request.Form("fldYear")
  m_lMonth = Request.Form("fldMonth")
  m_lDay = Request.Form("fldDay")
    
  'Fix the day of the month if we switch from a month that has less days in the month 
  'than the previously selected month and the day selected is not on the newly selected
  'month (ie - going from March 31st and then selecting February which does not have a 31st.)
  m_dtBegin = m_lMonth & "/1/" & m_lYear
  m_dtEnd = DateAdd("m", 1, m_dtBegin)
  m_lDaysInMonth = DateDiff("d", m_dtBegin, m_dtEnd)
  If CLng(m_lDay) > CLng(m_lDaysInMonth) Then m_lDay = m_lDaysInMonth
  
  'Build the Date
  m_dtCurrentDate = m_lMonth & "/" & m_lDay & "/" & m_lYear
  Dim formatofdate
  formatofdate = m_lDay&" "&MonthName(m_lMonth)&" "&m_lYear
  
  'If the date is not valid after all this then use the current date.
  If IsDate(m_dtCurrentDate) Then
   m_dtCurrentDate = CDate(m_dtCurrentDate)
  Else
   m_dtCurrentDate = Now()
  End If
  
 Else
  m_dtPassedInDate = …
william_stam 0 Junior Poster

you could set up a page that submits a form on load using javascript.... with the folowing script.

<% for each item in request.form
response.write "<input type=""hidden"" name="""& item &""" value="""& request.form(item) &""">"
next
 %>

and your form passes it on to the other server in the action field. with

<%= request.querystring() %>

after the url with a "?" mark first though. that way it will re submit all the form data aswell as the querystring.

the script thing creates a hidden field for all the form data submited with their names. hope it helps

william_stam 0 Junior Poster

server.execute doesnt work. what does work (compliments of "vbs in a nutshell") is

dim S
S = "sub Proc2 : "
S = S & "dim x : "
S = S & "x = 10 : "
S = S & "MsgBox x : "
S = S & "End Sub "

Execute S
Proc2

as i understand it executing "s" only uses the code that "s" is linked to, the variable "s" does nothing. once you have executed then you still have to do something with it. in this case call the sub.

i havent tried this in my case yet, havent had the time yet. will do so soon i hope.

william_stam 0 Junior Poster

its possible. an intranet is basicaly a website, so anything you can do for the web you can do for intranets. my question to you is why would you want to. ordinary html is sooo limiting, unless you want to have a basic birthday callendar type thing.

to set it up, you will need one computer with with a web server (IIS, Apache) since this is asp thread, stick to IIS. if the other computers can ping that computer and IIS is setup, then all you have to do is out the files into the wwwroot folder and enter that computer's ip adress in the address bar of your browser.

william_stam 0 Junior Poster

i used MySQL bible and mysql's help file (its more like a book than a help file)

william_stam 0 Junior Poster

i know this is seriously late

so you want to store the mp3's in the database? why not just use the database to link to them so
user interface (html with serverside scripting) - database - files dumped into a folder

that way you can have various user interfaces and almost no performance issues on the db. most phones and pdas can browsw html

william_stam 0 Junior Poster

you will need to have the database servers ip or dns name

mysqldump --opt databasename > path_and_filname.sql

or from your cmd prompt

mysqldump -h hostserver -u username -ppasword --opt databasename > path_and_filname.sql

restoring it is the above with the > changed to < if im not mistaken

william_stam 0 Junior Poster

SHOW PROCESSLIST;

then

KILL ???

??? being the id value for the process

william_stam 0 Junior Poster
UPDATE `adds` SET `client` = 'client1',`TOTALCOST` = 'totalcost' WHERE `ID` =9710
INSERT INTO `adds` ( `ID` , `client` , `colour`) 
VALUES (
NULL , 'sda', 'ads');

try like that

william_stam 0 Junior Poster

"A simple combination of check routines and loops should do the trick."


how????? ive started with the generate asp pages of code then execute but idealy i want it to out pu the whole thing to a text file so that goes out the window.

basicaly i want a asp variable thats in text
var = "date()" to be later on read as date(), asp code, this is just an example

william_stam 0 Junior Poster

hi

i have a page that generates asp code as text.

this all works well, but i need the same page to take the generated code and use it as asp again. is this even possible?

<% VARdate = "date()"
' now to use the VARdate
response.write(VARdate) %>

this is just an example. the code im working with checks to see what tables are available from a mysql database, runs an explain on them (to see what columns there are) then it runs a recordset outputing the data of those columns.

im trying to create a way of backing up a database with JUST asp.

if i could only get asp to read code thats in "text" as asp code, im sure it would work. cause if i take the generated code on IE. place it in an asp document it works fine.

PLEASE SAY ITS POSSIBLE and how to go about it

william_stam 0 Junior Poster
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<% If request.Form("emailtoad")<>"" Then %>
<%

' Send by connecting to port 25 of the SMTP server.
Dim iMsg 
Dim iConf 
Dim Flds 
Dim strHTML
Dim mailserver

mailserver = "mail server"   ' enter a valid mail server

Const cdoSendUsingPort = 2

set iMsg = CreateObject("CDO.Message")
set iConf = CreateObject("CDO.Configuration")

Set Flds = iConf.Fields

' Set the CDOSYS configuration fields to use port 25 on the SMTP server.

With Flds
    .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = cdoSendUsingPort
    .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = mailserver 			
    .Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 10  
    .Update
End With

' Apply the settings to the message.
With iMsg
    Set .Configuration = iConf
    .To = Request.Form("email")
    .From = "something@something.com" 
    .Subject = "Subject Goes here"
    .HTMLBody = "this is the mails body"
    .Send
End With

' Clean up variables.
Set iMsg = Nothing
Set iConf = Nothing
Set Flds = Nothing

%>
<% End If %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Test</title>
</head>

<body>
<form name="form1" method="post" action=""> 
<select name="emailtoad">
	<option selected>Please select a category</option> 
	<option value="sales@dawn.com">Sales</option> 
	<option value="support@dawn.com">Technical Support</option> 
	<option value="jobs@dawn.com">Employment Opportunities</option> 
	<option value="web@dawn.com">Web development</option> 
</select>
 <input type="submit" name="Submit" value="Submit">
</form>
</body>
</html>

you will just have to put your other form fields in, im too lazy at the moment to do so.

william_stam 0 Junior Poster

i need to run a backup script for a mysql database how do i run "mysqldump" from asp?

ive tried aspexec and mcs but no luck. am i missing something?

basicaly i need to be able to backup a database at a click of a button in an asp application.

thanks in advance

william_stam 0 Junior Poster

<form name="form1" method="post" action="">
<select name="select">
<option value="email1@something.com">email 1</option>
<option value="email2@something.com">email 2</option>
<option value="email3@something.com">email 3</option>
<option value="email4@something.com">email 4</option>
</select>
</form>

<% ' with the cdo script put "to" email address to the value of the select box %>

william_stam 0 Junior Poster

my biggest gripe with it is that its a resource hog, but ive heard lil birdies tweeting about the usual stuff like security and stability.

william_stam 0 Junior Poster

downgrade to xp then. 2003 is a base system they took out all xp junk to make it stable. if you want a xp looking computer USE xp. enough of a rant the login screen ive heard has a few "issues" to it, i for 1 am glad 2003 hasnt got it.

william_stam 0 Junior Poster

or use javascript to submit the form and vbscript to use the value of the checkbox submited if the messages are pulled from a db.

william_stam 0 Junior Poster

set the select box to submit the form. then have the next select box request.form("firstselectvalue") it. that way you can set up a if select1 hasnt been submited the disable select 2 etc

william_stam 0 Junior Poster

you lot have left it a tad late havent you?
whats the criteria? and how extensive should it be?

william_stam 0 Junior Poster

in the first examples you were using an access database. the last one if for a mysql database.

with the access errors i found that under certain cercamstances (i dont know whick ones tho) the server map path part errors out. try putting the exact path to the database (if one can call access a database to start with).

let me know which database you are using tho

william_stam 0 Junior Poster

therwise just use the meta print thiny. it prints an entirely different page to the one showed. so set up 2 asp pages. 1 to be viewed, 1 to be printed

william_stam 0 Junior Poster

use cookies and session vars.

dim saveinfo1
if request.cookie("testcookie")="" then
saveinfo1 = session("saveinfo1")
else
saveinfo1 = request.cookie("saveinfo1")
end if

bah, this way if the user has cookies blocked it uses the session (testcookies is a set cookie with any value) otherwise it uses the cookie

william_stam 0 Junior Poster

are you trying to get it to fax to the hotel or send them an email of the fax?

william_stam 0 Junior Poster

most common database for asp is mssql and access. i use asp and mysql (freelance developers cant really afford mssql's licencing). google still stays the best place for information. daniweb isnt so bad either. if you get stuck and cant get right the other ways email me, if i can help i will

william_stam 0 Junior Poster

why do you really need to have a trusted connection? if the site is https and the hosting company is straight (or trusted users only on the computer) its secure enough. the username and password is not sent in the content / pages. its all handled on the server. to get added protection ssl the trafic from the webserver to the database server.

william_stam 0 Junior Poster

to my knowledge its still cdonts.newmail etc.. the messege thing is a new bit they are working on or something. the upgrade to cdonts... is cdosys.

william_stam 0 Junior Poster

also use option 3. aparently it makes a difference

william_stam 0 Junior Poster

hey.
ive been away for awhile.... lets just say that its very impressive the changes made.... congrats dani

william_stam 0 Junior Poster

paste the code. but to my knowledge its imposible unless its a runtime error

william_stam 0 Junior Poster
<form id="form1" name="form1" method="get" action="next.asp">
  <select name="vendor" id="vendor">
    <option value="1">vendor1</option>
    <option value="2">vendor2</option>
    <option value="3">vendor3</option>
    <option value="4">vendor4</option>
    <option value="5">vendor5</option>
  </select>
  <input type="submit" name="Submit" value="Submit" />
</form>

then on your contact page have a recordset retrieve the values from the dbase using response.querystring("vendor") the above code sends the vale to the option in a querystring

william_stam 0 Junior Poster

explain? ive never heard of inet activex before. if you want to send info through a url it request.querystring("id") would retrieve testing from test.asp?id=testing

william_stam 0 Junior Poster

the other thing is, im not sure about the others but since you are asking about an asp problem only put the asp code. and maybe the relevant form

william_stam 0 Junior Poster

the easiest way is to run a resordset with the details as where clauses. then have an if the recordset is empty then insert new records else redirect to a page that says those details exist

william_stam 0 Junior Poster

there is no way for finding out if the user clicked save or cancel. your best bet to find that info is to add something to the actual file that registers being requested, for that you will need a component on the server or something. if you find an answer PLEASE let me know. ive been searching for about the last year

william_stam 0 Junior Poster

im not sure about "free" part. most editors that are capable of saving a asp file without you adding ".asp" to it should be able to check syntax. for the best programme in my opinion use dreamweaver, it aint cheap but it rocks.

william_stam 0 Junior Poster

paste your sql statement

william_stam 0 Junior Poster

Try

<% trackname = "track"&i %>
<%=rs1(trackname)%>

william_stam 0 Junior Poster

use javascript or on button clicked refresh page. i would suggest the javascript route.

william_stam 0 Junior Poster

create a sql dump and send it to the web space company? with a very nice letter asking very nicly for them to so it. works best.

william_stam 0 Junior Poster

if you are sending the email as html you can use standard html paragraph mark <p>

objMail.TextBody = Request.Form("emailText") & "<p> Contact Phone Number: (" & Request.Form("phoneArea")...

william_stam 0 Junior Poster

same as your checkbox query.

give each textfield a different name i sugest something like "quant<%= rs("id") %>" where id is the "id" value of the record its suposed to belong to.