Instr Type Function
I've been given a large database of "model numbers". based on these model number I have to do something different. example model numbers:
B2020-SG1
B2020-SG4440
B2020-LG3
B2020-LG33E
B2020-SG1-SG1
B2020-SG1TD9-SG1
B2020-SG1TD15-SG4440
Basically, the first number (B2020, which could be a number of different numbers) is the model. the second and/or third number is what I have to act on. The problem is, how do I pull that third number? Especially if its the same as the first number. right now I'm using Instr(variable1, "SG1") to pull each different set of numebrs. but that only finds the first occurence. what about the 2nd? how can I find that?
View Replies
ADVERTISEMENT
My question is
I use:
-----------------------------
dim strText,pos
strText = "This is a test!!"
pos = Instr(strText,"a",1)
response.write pos
-----------------------------
and i get:
Type mismatch: '[string: "This is a test!!"]'
What's going on?
View Replies
View Related
I have a string --> 7,8,9,10. This string may contain more or less than 4 numbers.
I want to separate each number and run an sql query for each number.
for example:
select * from table1 where code = '7'
select * from table1 where code ='8'
and etc....
Can I do this in a loop?
View Replies
View Related
I want to use the instr function, but return results from it depending on surtain functions, I can't realy explain so I'll show my example:
I have a string in wich some word I want to find might be in diffrent Capital Letters order, I want the Instr function to return all the values of the place of that word (avcourse I'll run a for and increase the starting point of the Instr func until it returns 0). The instinct thought is to use the Lcase or the Ucase functions, but in this case I don't know how to use them. In the same Idea I wanted to use the Instr Func with the trim Func, But Its realy the same principle if I just understood how to do so.
View Replies
View Related
is there any function similar to curl in asp? what i want to do is to extract the information from the webpage.
View Replies
View Related
request.asp:
<%
response.buffer=true
function managestatechange
response.write("objXMLHTTP.readyState: " & objXMLHTTP.readyState & "<br/>" & vbCrLf)
response.flush()
end function
dim objXMLHTTP, strForm
strForm=request.form
response.write("Sending:" & strForm & "<br/><br/>" & vbCrLf)
set objXMLHTTP=CreateObject("MSXML2.ServerXMLHTTP")
objXMLHTTP.Open "POST", "************", false
objXMLHTTP.onreadystatechange = managestatechange
objXMLHTTP.setRequestHeader "lastCached", now()
objXMLHTTP.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
objXMLHTTP.send strForm
response.write("Response: " & objXMLHTTP.responseText & "<br/>" & vbCrLf)
set objXMLHTTP = nothing
%>
Result:
Sending: CMN=wmdj3847WNSJ8383&Modi=0208&Pan=4444444444443333&ExpMnth=12&ExpYear=06&IssNo=&StarMnth=12&StarYr=04&CV2=123&PostCode=AB12CD&HouseNum=1&EmReq=1&Value=10&OrderNumber=GOL-2005-00000&IsoC=GBR
objXMLHTTP.readyState: 1
Microsoft VBScript runtime error '800a000d'
Type mismatch: 'managestatechange.onreadystatechange' request.asp, line 34
Why does it work once then fall over? What am I doing wrong?
View Replies
View Related
Why does this code Code:
Dim mytext
mytext = "Tristique, sed tamen typicus amet, bene quia feugait eu. "
Response.Write Instr(mytext, "tamen")
Gives the response "16"? Surely this word only appears once? Is it counting letters? How can I make it identify just words?
View Replies
View Related
How do I use InStr to find the string d="1"
I have tryed:
InStr(text,"d="1"") and it does not work
I have tryed a few other variations and I cant get it to work.
View Replies
View Related
I dont want those Disp selected from access db...I am getting an error..How will I do that ?
Microsoft VBScript runtime error '800a000d'
Type mismatch: '[string: "49, 50"]'
/drv_sch/Generate_Sch.asp, line 55
----------------------------------------
Driver_id is a number...Disp variable has these data "49, 50, 51"
SELECT * FROM schedule WHERE not instr('Disp',driver_id)
View Replies
View Related
I am searching a string that look like this (21,5,15,25) using Instr().
So, if I am searching for '5', I get everything that contains a five.
If InStr("21,5,15,25", req,QuerStr("id") Then
response.write "yes"
End If
I want only the one value '5' to get found but anything that contains a 5 is found. I have tried using Cint and Int to no avail.
View Replies
View Related
I have a field name "tracks" of string data type that has multiple names in it (for example: calder delaware$ aqueduct ), and I want to check to see if this certain field has "delaware$" in it. InStr or the Mid functions return the numerical order of where that string starts inside the string, but it doesnt tell me if "delaware$" exists in "tracks".
View Replies
View Related
was the instr() in asp means... meaning - why it is used.
View Replies
View Related
Using MySQL as a DB, I'm generating an OTF SQL statement that looks for matches in a comma delimited string. The code ends up looking something like this: Code:
View Replies
View Related
I am having a problem with the following code:
<%
If Len(TestRS.Fields.Item("Testimonial").value) > 150 Then
Response.Write(Left(TestRS.Fields.Item("Testimonial").Value,150)&""... <br><font size=1><a href=""/Testimonials.asp"">Read More</a></font>")
Else
Response.Write(TestRS.Fields.Item("Testimonial").Value)
End If
%>
I am getting a null response from TestRS.Fields.Item("Tesimonial").Value after it is processed by the Len function.
I am getting the following result: Quote: "... Read More This tells me that the len function is analysing the string to be greater than 150 charachters yet the string is not being expressed.
View Replies
View Related
Which is better practice?
Code:
Select * From groups Where groupName LIKE '%bli%' AND cusType LIKE 'CUST%'
or
Code:
Select * From groups Where InStr(groupName,'li')>0 AND InStr(cusType,'CUST')=1
Right now I'm using and Access database but plan to upsize to a MSSQL if that makes any difference. Are there any advantages or disadvantages to either technique?
View Replies
View Related
Just used this code and noticed it doesn't always work, turns out InStr is case sensitive.What's thet best way to do a non-case sensitive search?pHP Code:
IF INSTR(VideoName,"HiRes") THEN
View Replies
View Related
I'm having some trouble with an error that is thrown when I use InStr() and Mid() with a database search query. In point form:
I am retrieving an array strings from my database where the query is case insensitive. This is good.
Then I locate the keyword in the string using InStr() which is case sensitive. This is not desireable as it doesn't recognize all instances of the keyword.
I use the Mid() function to give me a portion of the string starting at the location provided by InStr() which is sometimes the number zero which in turn throws the error.
View Replies
View Related
I get this error melding >>>Invalid procedure call or argument: 'InStr' and this is the code where this error refers to:
If (InStr(r, UCase(strRetVal), "<TABLE>") > 0) AND _(InStr(r, UCase(strRetVal), "<TABLE>") < _
InStr(r, UCase(strRetVal), "</TD>")) then ThisCellText = mid(strRetVal, StartCellText, _
InStr(r, UCase(strRetVal),"<TABLE>")- StartCellText )
Else
ThisCellText = mid(strRetVal, StartCellText, _
InStr(r, UCase(strRetVal), "</TD>")- StartCellText )
End If
in this area i am doing something, can anyone plz direct me and tell whats wrong?
View Replies
View Related
I got a problem while running an application. The code for this is as follows:
aList = Split(strMsg,";")
For nX = 0 to UBound(aList)
strarry=split(aList(nX),"_")
var_year=left(strarry(2),4)
var_month=mid(strarry(2),5,2)
var_day=mid(strarry(2),7,2)
var_date=var_day&"-"&var_month&"-"&var_year
var_time1=mid(strarry(2),9,2)
var_time2=mid(strarry(2),11,2)
var_time=var_time1&":"&var_time2
set rs1=conn.execute("insert into tbl_BackupfileInfo(Filename,Createddate,Createdtim e)values('" &aList(nX)&"','"&var_date&"','"&var_time&"')")
Next
while runnig this application some times it works fine .But some times it giving an error
Error Type:Microsoft VBScript runtime (0x800A000D) Type mismatch: 'UBound'.
View Replies
View Related
What's the difference between private and public functions in ASP? When should I use either?
View Replies
View Related
I have a variable - a large string of text - called row1. Im using VBscript to parse this row for useful information that I need. The row1 starts off as follows:
bSlip('SO','3664746','','abc','',0)>abc</a></td><td class=o>;</
Im using the position of the bSlip ---- Instr(row1, "bSlip(") to find out where the bSlip text starts and this works fine. The next few lines of text are supposed to use the position of the ">" character and the "<" character to extract the text in between. Code:
View Replies
View Related
I am trying to send a fax from my asp application and am getting the follwoing error on the hghlighted line:
Error Type:
(0x80004005)
Unspecified error
If anyone knows why..Code:
View Replies
View Related
I have a table with four fields, ID (auto increment), question (varchar(200)), answer (Text), and shop (tinyint(3). When I connect to the database in an ASP page and write this code
Response.Write rs("question") & "<br />" & rs("answer")
I get an error that reads "Type Mismatch"
but if I change the type of the answer field to type varchar I don't get the error but am limited in the length of the field's contents. I just also noticed that if I keep the type at TEXT and change the collation to ascii_general_ci I don't get the mismatch error but all the ' characters turn into ? characters? Oh woe is me.
View Replies
View Related
I am using a simple guestbook /portal and i want script to send mail to the thread owner when someone reply his message.
this is the send message code ....
View Replies
View Related
Can I define a function inside a function. e.g;
function abc()
function xyz()
....some code.....
End Function
End Function
I googled this but can't find any related topic.
View Replies
View Related
I was looking for an app that i could use as a glossary, though i'm not sure how you would refer to it.
Basically, something that has 0-9 and A-Z with a search feature, by hitting G, all the items starting with G would appear, etc.
View Replies
View Related
I am moving a mySQL db from one server to another. My backup sql is coming from phpMyadmin and I am using another 3rd party db admin program on the server. I am copying and pasting this code:
View Replies
View Related
I have an access database, with a form field "scores", which is a text field. This is the code (i have included the database code in the script btw):
<%
Dim scoresql,scorers
scoresql = "SELECT * FROM users"
Set scorers = conn.execute(scoresql)
Do
scores = Split(scorers.fields("scores"),"~")
Response.Write(scores)
scorers.movenext
Loop while not scorers.eof
%>
I can't tell what's wrong.
View Replies
View Related
if you can I am getting this errror:
Microsoft VBScript runtime error '800a000d'
Type mismatch: 'FormatDateTime' /bb/aspBoardDetail.asp, line 57
<tr><td><font face="<%=abFont%>" size="-1">When: <%=FormatDateTime(adoRs.Fields("msgTime").Value, 2)%> <%=FormatDateTime(adoRs.Fields("msgTime").Value, 3)%></font></td></tr>
View Replies
View Related
After about 30 minutes of frustration I finally discovered what was
causing a general 500 internal server error and to my surprise it was
something I seem to always take for granted for its simplicity. A type
mismatch error trying to compare a string to a numerical value, which
is something that PHP has no problem or qualms with. However, this
continuous problem continues to haunt me year after year and has
brought me to tears with frustration. This is the line that raises the
error:
nID = Request("ID")
If IsNull(nID) Or IsEmpty(nID) Or nID = 0 Then
.... (and so on)
In the past I've written a function 30 lines long that compares values
by confirming value types of the variables first, but I would rather
put a gun to my head than do that. Since there are obviously other
bright PHP and ASP developers out there that constantly trip over this
problem, I would like to know your suggestions or methods of working
around this.
View Replies
View Related
I am new to ASP programming and I am trying to get an existing website to work.
I have created the following function to get the day:
function nrDate()
nrDate = DAY(Date())
end function
But when I use the page it gives the following runtime error:
Microsoft VBScript runtime error '800a000d'
Type mismatch: 'DAY'
I have googled the problem for hours but cannot find anything that may be helpfull. Does anyone have any ideas because this is getting quite urgent and I cannot move forward without this function.
View Replies
View Related
Microsoft VBScript runtime error '800a000d'
Type mismatch: 'getTableFields'
Line is commented.
set exclusions = Server.CreateObject("Scripting.Dictionary")
exclusions.Add "id", true
exclusions.Add "timestamp",true
set tableKey = getTableFields("CIL_Addresses",exclusions) ''''TYPE MISMATCH ON THIS LINE
May be helpful to see getTableFields()
Code:
View Replies
View Related
Any Idea what this might mean?
Microsoft VBScript runtime error '800a000d'
Type mismatch: '[string: ""]' /App/Director_Appraisal_Results_Saved.asp, line 444
View Replies
View Related