Problem in String Manipulation

jenson
06-26-2003, 12:13 AM
I guess i have problem in string manipulation...

If i type in "Select Admin_Id, Name From YYY"

How should i break up the sentence??
I tried,
Begin = Left(strData,7)
End = (Instr(strData,",")-1)
Length = End - Begin
New String = Mid(strData, Begin, Length)

I dun understand the last part of the 'NEW STRING' command.
The above what i understand is use for getting "Admin_Id" from the strData...But how should i retrieve Name??

What if i have another command like
"Select Admin_Id, Name, Venue From YYY"
How do i retrieve the "Venue" in the strData??

Can any Guru pls help me...

Bram88
06-26-2003, 04:22 AM
Begin = Left(strData,7)
End = (Instr(strData,",")-1)
Length = End - Begin
New String = Mid(strData, Begin, Length)


The Left function returns a string (the first 7 characters of strData) and not a number. I guess you meant Begin = 7.

Have you already tried the Split function? It splits the function into an array of strings using the comma (or another character) as a seperator.

jenson
06-26-2003, 08:38 PM
I found from w3schools...
http://www.w3schools.com/ado/ado_display.asp

Dim x, Response

x = "Admin_Id" & "Name" & "Venue"

do until rs.EOF
for each x in rs.Fields
Response.Write(x.name)
Response.Write(" = ")
Response.Write(x.value)
next
Response.Write
rs.MoveNext
loop

Its seems better but it prompt "Could not find procedure 'Admin_IdNameVenue'."

Any guru can explain to me what happen...

blindwig
06-26-2003, 09:14 PM
I found from w3schools...
http://www.w3schools.com/ado/ado_display.asp

Dim x, Response

x = "Admin_Id" & "Name" & "Venue"

do until rs.EOF
for each x in rs.Fields
Response.Write(x.name)
Response.Write(" = ")
Response.Write(x.value)
next
Response.Write
rs.MoveNext
loop

Its seems better but it prompt "Could not find procedure 'Admin_IdNameVenue'."

Any guru can explain to me what happen...
Well, the line

x = "Admin_Id" & "Name" & "Venue"

is going to assign x the string value of "Admin_IdNameVenue". I would assume that the "for each" command needs some kind of delimited between the parameters so it can seperate them out.
I think you should be doing something more like this

x = "Admin_Id" & strDelimiter & "Name" & strDelimiter & "Venue"

jenson
06-26-2003, 11:20 PM
I found from w3schools...
http://www.w3schools.com/ado/ado_display.asp

Dim x, Response

x = "Admin_Id" & "Name" & "Venue"

do until rs.EOF
for each x in rs.Fields
Response.Write(x.name)
Response.Write(" = ")
Response.Write(x.value)
next
Response.Write
rs.MoveNext
loop

Its seems better but it prompt "Could not find procedure 'Admin_IdNameVenue'."

Any guru can explain to me what happen...
Well, the line

x = "Admin_Id" & "Name" & "Venue"

is going to assign x the string value of "Admin_IdNameVenue". I would assume that the "for each" command needs some kind of delimited between the parameters so it can seperate them out.
I think you should be doing something more like this

x = "Admin_Id" & strDelimiter & "Name" & strDelimiter & "Venue"


But it does not reconginze strDelimiter when debugging...

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum