 |
 |

06-26-2003, 12:13 AM
|
|
Newcomer
|
|
Join Date: Jun 2003
Posts: 24
|
|
Problem in String Manipulation
|
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...
|
|

06-26-2003, 04:22 AM
|
|
Newcomer
|
|
Join Date: Jun 2003
Posts: 4
|
|
Quote: Originally Posted by jenson
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.
|
|

06-26-2003, 08:38 PM
|
|
Newcomer
|
|
Join Date: Jun 2003
Posts: 24
|
|
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...
|
Last edited by jenson; 06-26-2003 at 08:44 PM.
|

06-26-2003, 09:14 PM
|
 |
Ultimate Contributor
* Expert *
|
|
Join Date: Jun 2003
Location: New York, NY
Posts: 1,929
|
|
Quote: Originally Posted by jenson 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
Code:
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
Code:
x = "Admin_Id" & strDelimiter & "Name" & strDelimiter & "Venue"
|
__________________
"Fortunately, I live in the United States of America, where we are gradually coming to understand that nothing we do is ever our fault, especially if it is really stupid." - Dave Barry
|

06-26-2003, 11:20 PM
|
|
Newcomer
|
|
Join Date: Jun 2003
Posts: 24
|
|
Quote: Originally Posted by blindwig
Quote: Originally Posted by jenson 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
Code:
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
Code:
x = "Admin_Id" & strDelimiter & "Name" & strDelimiter & "Venue"
But it does not reconginze strDelimiter when debugging...
|
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|
|
|
|
 |
|