Vbscript [object] Strings?

in javascript attempting to get a string from somewhere sometimes will give you a string reading "undefined" or "object" now i know that this sort of thing happens in vbscript too, if i'm writing a universal "convert anything to a string" function what do i need to check for so that anything like "undefined" or "null" (or NULL) get's converted into ""?

View Replies


ADVERTISEMENT

VBScript : Constants, Variables And Strings

I have the following problem.

I'm building a site with a db backbone.
In an "include file" I set a constant like:

Const partners = 22

and on some other page, I want to pass the word partners using the query string.

Meaning: I want to make such a link:

href="mypage.asp?module=partners"

When my page reads the querystring - I want it to be able to understand the value of the constant "partners".

when I read from the db using the following kind of Query, I get a "no value specified for one of more..." Code:

View Replies View Related

ASP Object Required Error - Vbscript

I am trying to use the following code to refer to a form and control on my
form. I am supposed to be using VBSCRIPT for this code.
I always get an "object required: 'document' " error:

<%
Dim Myform
Set Myform = document.forms.thisform
Myform.textbox1.value = "fish" %>

None of this code will work. Always get an error.
Using Visual Interdev, plain ole ASP, and vbscript, and Win XP Pro with IIS
5.1

What am I missing or doing wrong???

View Replies View Related

VBscript IIS And WScript.Shell Object

can SO tell me why the following script :

dim oShell
set oShell=WScript.CreateObject("WScript.shell")
oShell.run ("C:WINNTsystem32cmd.exe /c C:WINNTsystem32
otepad.exe")
set oShell=nothing

works as expected in the context of a .vbs script and doesn't work (with the following changes made...) when inserted in a .asp web page under IIS ?

dim oShell
set oShell=Server.CreateObject("WScript.Shell")
'
intReturn = oShell.run ("C:WINNTsystem32cmd.exe /c C:WINNTsystem32
otepad.exe")
response.write(intReturn)
set oShell=nothing

the Shell object is well created (i can check some of its properties) but the oShell.run command doesn't seem to execute the given command line.

View Replies View Related

VBScript Regular Expression Object

I've discovered an insidious bug with the VBScript Regular Expression
object.I set the pattern to consist of the set of invalid filename
characters plus comma. I set global property to true then do a replace on a
SID. The Replace does nothing. However, if I attach the C++ (dev studio
2003) debugger to the IIS host process (dllhost.exe), every time I call
RegExp.Replace, the stack for one of the process's threads gets scrambled.
It ends up with the value 0x00000001 at the top of the stack! If your
debugger is set to stop on access violations, it always catches one (invalid
read trying to delete). The problem is insidious because, without the
debugger running, you would never know this is happening. ASP returns no
error. Potentially this could wreak havoc on your web application and cause
bizarre failures later on. Has anyone else run into this one? It seems to
happen only with the Replace method.

View Replies View Related

ADO Record Object - Test For Last Iteration (VBScript)

I have a record object (for instance, named record). I record.MoveFirst, then I set up a simple little loop:

For Each ofield in record.Fields
...
Next

Within my loop, I want to test to see if it is the last iteration. That is, with a simple If...Then, I want to be able to complete something the last time through.

Is this possible, either with some sort of record.EOF type property, or some sort of record.Count type property (and then using a simple counter during iteration to count down until the last one)?

I'd like to try to be at least a little elegant... I understand its possible to iterate through the whole record twice, the first time to count, but that would obviously be a poor choice if any other method is available.

View Replies View Related

Microsoft VBScript Runtime Error '800a01a8' Object Required: ....

I'm getting a

Microsoft VBScript runtime error '800a01a8'

Object required: ''

/remove/addnow.asp, line 18

I can't seem to see what wrong here's my code.

Code:

View Replies View Related

Object Doesn't Support :: Microsoft VBScript Runtime Error '800a01b6'

I have almost completed tweaking vbscript to run on mysql rather than the Access database it was designed for. Trial and error, luck and a bit of detective work have got me this far, however I am getting the following error when tryinf to update existing records in the database.

Microsoft VBScript runtime error '800a01b6'
Object doesn't support this property or method: 'RS.Find'
/faq/admin/edit2.asp, line 7

The piece of script looks like this in Dweaver

Set RS = Server.CreateObject("ADODB.Recordset")
RS.Open "Questions", Conn, 2, 2
RS.Find "ID='" & Request("ID") & "'"

The .Find text is black whereas all other "methods"(?) like the .Open are pink. Is it that the .Find method works with access and not mysql and if so waht is the equivalent or am I barking up the wrong tree?

View Replies View Related

Strings

In a string what is the character I should use to represent an enter?

View Replies View Related

Strings

i am retrieving a record from the database, I am trying to place the value of the FULLNAME field in a textbox on a Form, the Problem is that it only displays half of the name leaving out the stuff that comes after a SPACE.

Example:

adors("fullname").value <--- Actual Value is John Smith
but it only displays John
Code:

<INPUT id=text1 readonly name=txtfullname value=<%=adors("fullname").value%>>

but if I try to just response.write it anywhere on the page then it displays the entire name.

View Replies View Related

Combining 2 Sql Strings

I have 2 SQL strings:

SELECT *
FROM NK_editie " & MM_whereConst & " " & whereClause & "
ORDER BY editie desc

And

SELECT *
FROM NK_editie INNER JOIN NK_edities ON NK_editie.editieid = NK_edities.ID
ORDER BY editie desc

Now I want to combine those 2 to one string.

I have problems to set it up in working order.
My tryout:
SELECT *
FROM NK_editie INNER JOIN NK_edities ON NK_editie.editieid = NK_edities.ID &
" & MM_whereConst & " " & whereClause & "
ORDER BY editie desc

It shows al the records which are joined, only the second string " & MM_whereConst & " " & whereClause & " is not working.

View Replies View Related

Placing Strings Onto Url

I found out a really nice way to keep things on the same page is for any processing page to add on a "?<something>=<something>"

and then just check to see what the something is equal to, and the number represents what you want the front page to show.

However, this <something> shows up on the url listing in a browser. Is there anyway to .. encode it so no one can see it? Like a encode/decode function?

View Replies View Related

" And ' In SQL Strings

I'm building a forum, and right now i'm creating the ability to edit posts. As part of this i want to add the usual "Edited by UserName on Date" line at the bottom, but am having problems doing so.

The problems seems to do with formatting the text in the variable with <span>s using stylesheets, or if there are " and ' markes in the post proper (which I can't seemt to remove with Replace). Here's my code:

View Replies View Related

Trimming Strings

if i had a string which looked like this :

,apple, orange, grape, tomatoes

how do i remove the first character[,] from the string using the trim() function?

View Replies View Related

Connection Strings

I am developing a website and it's going fine, but i've heard that you shouldn't have your database in the wwwroot, it should be outside/above that.

I've done this (i'm using Dreamweaver MX) so I moved the db, fixed my odbc/dsn, connection string etc, but when I upload now I get this error.

Microsoft JET Database Engineerror '80004005'

'C:Program FilesEnsimSiteDatawebpplianceconfdomainsInet pubwwwrootTesting_SiteDatabasesTesting_Website _DataSource.mdb' is not a valid path. Make sure that the path name is spelled correctly and that you are connected to the server on which the file resides. /Testing_Site/default.asp, line 8

This is line 8: Recordset1.ActiveConnection = MM_TestingConnection_STRING

Is there something that I have missed. It was ok when it was in the wwwroot.

View Replies View Related

Comparing Strings

i am having a problem with comparing two strings. I am taking
in the parameter rs("Company") and if this is empty i want to put some
text in there. I am testing it with an empty Company field and comparing
it like so:

temp1=rs("Company")
temp2=StrComp(temp1,NULL)

I have also tried it with
temp2=StrComp(temp1,"")

but each time i get nothing returned. Is there some rule about comparing a
string with an empty string?

View Replies View Related

Dns Connection Strings

I am using ASP to connect to a simple database to retreive information and also to imput information.What I need is a simple dns connection string syntax to connect and query data.

View Replies View Related

Search Strings...

I have a search function on my site, and what happens at them moment is the user fills in a text box with their search string, and clicks submit. The search page takes their string, and splits it up where it sees " ".

All fairly simple, what I'd like is to allow the user to enter text in speechmarks, so the script would search for a couple of words together, as well as being able to search for every individual word...

Everyone confused yet?!

e.g If the user enters Dev Shed Forums , then the search would look for every occurance of the strings "Dev", "Shed" and "Forums"

What I want is for the user to be able to enter "Dev Shed" Forums, and the search will look for "Dev Shed" and "Forums"...

View Replies View Related

Formating Strings

I have a list of dates in a sql database that are input as varchar like this 042999

How do I insert / in between the date/month and year

so this 042999 will appear like this 04/29/99

View Replies View Related

Concatenate Two Strings

if i've two strings like:Code:

dim pic_name=replace(Request.Form("pic_name"),"'","''")
dim pic_path="pro-details/PICs/"

how could i merge the two strings to get the complete pic-path

View Replies View Related

Strings With Quotes In

< input type=text name="PageTitle" id="PageTitle"
value="<%=strPageTitle%>" >

How do I "escape" any quotes, accidental carriage returns etc that are
contained within strPageTitle? Do I have to use a series of replace()
functions, or is there a cunning way that makes it OK?

(Using escape(strPageTitle) fills the box with % signs...)

View Replies View Related

Join Two Strings

I have 2 string

str1="John"
str2="Smith"

I need to join them and then i need to get 6 characters from the left

so here is my code
str3=str1&str2
str4=Left(str3, 6)

I need to see the output as johnsm

but it gives the output as john

View Replies View Related

Unescaping Strings

I am storing some strings via asp.net in my dbase. The string looks like this:

Well, that`s just a simple level 100 quiz aiming to imprint ""standard random number generators are not really random"" program to those who still lack it. What will produce the following C# snippet? ‘ ....

Now I am reading these values via ASP and need to print them out.

Unfortunaly it does not UnCode the string back so that I can show it to the user. I know I could use the replace function but I wont replace all chars, there are many from this type. What can I do?

View Replies View Related

Compare Two Strings

I was wondering how do you compare variables that contain text strings in ASP.When I use the following If. Then statement:

If Rs("StyleNo") <> arrStyleNo(aCount) Then

I always get the following error when I try to browse the page:

Error Type:
(0x80020009)
Exception occurred.

View Replies View Related

Compare Strings

I'm trying to see if a certain string matches a predefined string so I've tried:

--------------
If txtCondition3 = "NO THEFT COVER unless client claim free and occupied
prems for 3 yrs" Then
response.write "1st condition"
Else
response.write "2nd condition"
End If
--------------

But I'm getting neither response.

View Replies View Related

Converting Strings

I have a form with multiple text fields, when i submit the form i want it to edit a table in my database using UPDATE. I know i have the syntax correct. The problem I have is 2 fields are Currency and 2 are Date. The request.form command always returns a string and i keep getting the 'Data type mismatch in criteria expression' error. How do i convert the strings to dates, and strings to Currencies.

View Replies View Related

Strings And Tables

I am currently developing a registration application for the Boy Scouts. We have paper forms for those who choose not to use a computer to register. The paper forms have a box for each letter so that it is legible. how can i re-create the paper forms with ASP. For those who go online and register they need to print out the youths registration forms and I want them to look like the paper forms.

Now there are a few fields that are mutliple words so it would have to support spaces as well. Is there even a way to do this. I know it is going to be a pain for the good look it is going to be critical. I was thinking of using strings to simply seperate each letter and tell the script to simply repeat until. Is the right way?

View Replies View Related

Strings And Variables

Code:

Dim activation_code
activation_code="dkfjla54d2__sd4f__Sdf4sdf63ds2f168sd32f1wef4_" & Right(user,2) & "__sdf984231" & Left(mail,2) & Left(user,2) & "23a1sd_" & " right(mail,2) & hour(now)

its probably syntax error , i dont know how to connect strings and variables , but i though it is right this way , but obviously not ...

View Replies View Related

Add 2 Strings Numerically

i have 2 strings: a value in an array and a variable from some xml. I need to numeriaclly add them together, as they are both strings, using + doesn't work. I have tried cStr but it errors what do I do?

View Replies View Related

Randomly Generated Strings

I used to have a piece of code that would generate a random string of
8,16,24 or 32 characters in length.

I got it from this group, does any one have this piece of code?

It will be used for a double opt-in email newsletter.

View Replies View Related

Email Validation Strings

I've got a couple of strings I use to validate emails.

I have no idea what either of them do or what they mean! I found them, they work, so I use them!

Could somebody let me know what these mean? My guess is that the longer string is better, simply because it tests more thoroughly, but I could be mistaken.

String1 = ""^([a-zA-Z0-9_-.]+)@(([[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.)|(([a-zA-Z0-9-]+.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(]?)$""

String2 = "^w+([-+.]w+)*@w+([-.]w+)*.w{2,}$"

View Replies View Related

Concatenate Strings And Arrays

how to set a variable to the contents of an array from a certain element on

for example..

myArray(0)="zero"
myArray(1)="one"
myArray(2)="two"
myArray(3)="three"
myArray(4)="four"
myArray(5)="five"
myArray(6)="six"

I would like to set all values after two to a string variable..separated by underscores

str="three_four_five_six"

is there convenient string method for this ..?

View Replies View Related

Encode And Decode Strings

I have problem with what is seen in address bar.
I need a code to encode my queryStrings and again decode it
in the destination.So ther will be just unkown charecters for users in the address bar

View Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved