Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 15th, 2007, 01:31 PM
Authorized User
 
Join Date: Feb 2007
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Default Plz Help ASAP

I'm getting this error
Error Type:
Microsoft VBScript runtime (0x800A0009)
Subscript out of range: 'i'
/save_inc.asp, line 78

for i=0 to (sSim_num-1)
Line 78-
sql = "insert into srpcSims values (null,"&projID&",'"&sSim_host(i)&"','"&sSim_dir(i) &"','"&sSim_ip(i)&"',"&sSim_suid(i)&","&sSim_numBE S(i)&","&sSim_startPIN(i)&","&sSim_numPIN(i)&","&s Sim_dupPIN&",'"&sSim_authKey(i)&","&sSim_mthpyldsi ze(i)&","&sSim_contype(i)&"')"
    db_conn.execute(sql)
    next

    db_rec.close
    db_conn.close
    set db_rec = nothing
    set db_con = nothing

 
Old February 15th, 2007, 04:15 PM
Authorized User
 
Join Date: Feb 2007
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Now i'm getting an error
Microsoft VBScript runtime (0x800A01C2)
Wrong number of arguments or invalid property assignment: 'replace'
/createCFGs.asp, line 334

do while sqlFile2.AtEndOfStream <> true
Line 334 sqlFile3.writeline(Replace(Replace(Replace(sqlFile 2.ReadLine,"{SID_START}",sSim_sid(i)),"{SID_END}", (CLng(sSim_sid(i))+CLng(sSim_numB(i))-1)&""),"{AUTH_KEY}",sSim_authKey(i),sSim_pyldsize(i),sSim_contype(i)))

i'm trying to add the ones in bold .Plz help

 
Old February 15th, 2007, 04:23 PM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

Ok wow. I would highly recommend you rethinking that process because that is about impossible to read. The replace() function in ASP only takes 3 parameter Replace(string, 'oldvalue', 'newvalue') You have, I think, supplied 5 values to the outer most replace.

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from planoie's profile^^
^^Modified text taken from gbianchi profile^^
================================================== =========
Technical Editor for: Professional Search Engine Optimization with ASP.NET
http://www.wiley.com/WileyCDA/WileyT...470131470.html
 
Old February 15th, 2007, 04:26 PM
Authorized User
 
Join Date: Feb 2007
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hey , actually i'm beginner in this...
could u plz help me out some more on this ...what other info is needed to solve this prob ?

 
Old February 15th, 2007, 04:34 PM
Friend of Wrox
 
Join Date: Jul 2003
Posts: 599
Thanks: 6
Thanked 3 Times in 3 Posts
Default

Try your replace statements one at a time until you get them all to run without errors and then you can consider combining them together. Or get one working, then add a Replace and then another.

 
Old February 15th, 2007, 04:38 PM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

Dim s1, s2, s3

s3 = Replace(sqlFile2.ReadLine,"{SID_START}",sSim_sid(i ))
s2 = Replace(s3,"{SID_END}",(CLng(sSim_sid(i))+CLng(sSi m_numB(i))-1)&"")
s1 = Replace(s2, "{AUTH_KEY}",sSim_authKey(i),sSim_pyldsize(i),sSim _contype(i)) <-- this line is going to error everytime like this, you have way to many parameters

In so far as a solution, remember that a replace statement only takes 3 values.

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from planoie's profile^^
^^Modified text taken from gbianchi profile^^
================================================== =========
Technical Editor for: Professional Search Engine Optimization with ASP.NET
http://www.wiley.com/WileyCDA/WileyT...470131470.html
 
Old February 15th, 2007, 05:00 PM
Authorized User
 
Join Date: Feb 2007
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Default

k ,say if i break it as u suggested then how do i include
sqlFile3.writeline.....with these s3,s2,s1.
actually i was trying to make some changes .. these sSim_pyldsize(i) ,sSim_contype(i) i want to write in seperate lines ...they are of integer and text type respectively . plz advise ?

 
Old February 15th, 2007, 05:08 PM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

Your original code does not reflect that you are trying to write seperate lines, your code just writes one line for every line in a SQL File.

In any case, if it were me i would do something like

do while sqlFile2.AtEndOfStream <> true
    s3 = Replace(sqlFile2.ReadLine,"{SID_START}",sSim_sid(i ))
    s2 = Replace(s3,"{SID_END}",(CLng(sSim_sid(i))+CLng(sSi m_numB(i))-1)&"")
    s1 = Replace(s2, "{AUTH_KEY}",sSim_authKey(i),sSim_pyldsize(i),sSim _contype(i))

    sqlfile3.writeline(<value you want to write to file>)
loop

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from planoie's profile^^
^^Modified text taken from gbianchi profile^^
================================================== =========
Technical Editor for: Professional Search Engine Optimization with ASP.NET
http://www.wiley.com/WileyCDA/WileyT...470131470.html
 
Old February 15th, 2007, 05:14 PM
Authorized User
 
Join Date: Feb 2007
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Now when i'm doing the same including
sqlfile3.writeline(sSim_pyldsize(i)) it gives an error

Microsoft VBScript compilation (0x800A03EE)
Expected ')'
/createCFGs.asp, line 334, column 197
sqlFile3.writeline(Replace(Replace(Replace(Replace (Replace(sqlFile2.ReadLine,"{SUID_START}",sSim_sui d(i)),"{SUID_END}",(CLng(sSim_suid(i))+CLng(sSim_n umBES(i))-1)&""),"{AUTH_KEY}",sSim_authKey(i)))



 
Old February 15th, 2007, 05:23 PM
Authorized User
 
Join Date: Feb 2007
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Oh k , i got that part ..now its able to write those 2 parameters as well ! thanks a lot







Similar Threads
Thread Thread Starter Forum Replies Last Post
plz.....plz solve out my problem.... kethireddy435 ASP.NET 1.x and 2.0 Application Design 1 October 4th, 2007 12:56 PM
plz help me ASAP developer.ibm Java Basics 4 August 22nd, 2007 12:32 PM
Need Help ASAP coding C# 1 June 6th, 2007 12:41 AM
Plz Help ASAP phantom3008 Classic ASP Basics 3 March 2nd, 2007 05:55 PM
HELP! HELP! Please ASAP iamucha Access 2 March 25th, 2004 11:42 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.