 |
| 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
|
|
|
|

February 16th, 2007, 11:50 AM
|
|
Authorized User
|
|
Join Date: Feb 2007
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
here is the file, plz see if u could find out where is the mistake .....
sSim_num = Request.Form("sSim_num")
sSim_host = split(Request.Form("sSim_host"),"|")
sSim_dir = split(replace(Request.Form("sSim_dir"),"\","\\")," |")
sSim_ip = split(Request.Form("sSim_ip"),"|")
sSim_suid = split(Request.Form("sSim_suid"),"|")
sSim_numBES = split(Request.Form("sSim_numBES"),"|")
sSim_startPIN = split(Request.Form("sSim_startPIN"),"|")
sSim_numPIN = split(Request.Form("sSim_numPIN"),"|")
sSim_dupPIN = Request.Form("sSim_dupPIN")
sSim_authKey = split(Request.Form("sSim_authKey"),"|")
sSim_mthpyldsize = split(Request.Form("sSim_mthpyldsize"),"|")
sSim_contype = split(Request.Form("sSim_contype"),"|")
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_mthpyld size(i)&"','"&sSim_contype(i)&"')"
db_conn.execute(sql)
next
db_rec.close
db_conn.close
set db_rec = nothing
set db_con = nothing
else
projName = Request.Form("projName")
projComments = Request.Form("projComments")
modName = Request.Form("modName")
set db_conn = server.createobject("adodb.connection")
'db_connstr = "Driver={MySQL ODBC 3.51 Driver}; Server=localhost; Database=testdb; uid=root; pwd=bb3ngtr4.; port=3306; option=16386;"
db_conn.open(db_connstr)
updateFolderName()
sql = "update projects set modDate='"&DatePart("YYYY", Date)&"-"&DatePart("M", Date)&"-"&DatePart("D", Date)&"', modName='"&modName&"', projName='"&projName&"', projComments='"&projComments&"' where id="&projID
db_conn.execute(sql)
sSim_num = Request.Form("sSim_num")
sSim_host = split(Request.Form("sSim_host"),"|")
sSim_dir = split(replace(Request.Form("sSim_dir"),"\","\\")," |")
sSim_ip = split(Request.Form("sSim_ip"),"|")
sSim_suid = split(Request.Form("sSim_suid"),"|")
sSim_numBES = split(Request.Form("sSim_numBES"),"|")
sSim_startPIN = split(Request.Form("sSim_startPIN"),"|")
sSim_numPIN = split(Request.Form("sSim_numPIN"),"|")
sSim_dupPIN = Request.Form("sSim_dupPIN")
sSim_authKey = split(Request.Form("sSim_authKey"),"|")
sSim_mthpyldsize = split(Request.Form("sSim_mthpyldsize"),"|")
sSim_contype = split(Request.Form("sSim_contype"),"|")
sql = "delete from srpcSims where id="&projID
db_conn.execute(sql)
for i=0 to (sSim_num-1)
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_mthpyld size(i)&"','"&sSim_contype&"')"
db_conn.execute(sql)
next
'generationDate = Request.Form("date")
'sql = "insert into generationDates values (" & projID & ",'" & generationDate & "')"
'db_conn.execute(sql)
'db_rec.close
db_conn.close
set db_rec = nothing
set db_conn = nothing
end if
|
|

February 16th, 2007, 11:51 AM
|
|
Authorized User
|
|
Join Date: Feb 2007
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
i want to add these last two rows
sSim_mthpyldsize = split(Request.Form("sSim_mthpyldsize"),"|")
sSim_contype = split(Request.Form("sSim_contype"),"|")
before adding these everything was working fine .
|
|

February 16th, 2007, 12:31 PM
|
|
Authorized User
|
|
Join Date: Feb 2007
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
hey dparsons
did u see anything there or any more info is needed ... PLZ advise !
|
|

February 16th, 2007, 12:35 PM
|
|
Wrox Author
|
|
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
|
|
your problem, i think, is that you are making a dynamic array by calling Split() in your variable initialization so, my guess is, some of your arrays have more fields then others which is why your getting the out of bounds error.
================================================== =========
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
|
|

February 16th, 2007, 12:41 PM
|
|
Authorized User
|
|
Join Date: Feb 2007
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
k , but the thing is , it was working fine before i added these two lines
sSim_mthpyldsize = split(Request.Form("sSim_mthpyldsize"),"|")
sSim_contype = split(Request.Form("sSim_contype"),"|")
so plz tell me how do i fix it .. actually i'm a beginner in this ..so i would request you to elaborate a bit more as to how should i fix the problem.
|
|

February 16th, 2007, 12:48 PM
|
|
Wrox Author
|
|
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
|
|
Remove those 2 lines above. Does your code work fine? If yes then this is the reason why.
Consider this string:
This|is|only|a|test
When i call split on this it will give me an array whos upperbound element is 4 so doing this
response.write(myArray(4)) will write test to the screen.
Now consider this string
Hello|World|!
When i call split on this string I will get an array whos upper bound element is 2 so response.write(myArray2(2)) gives me !.
Now, if i create a loop that does this:
for i=0 to UBound(myArray1)
response.write(myArray1(i))
response.write(myArray2(i))
next
This code will generate an error when i gets to 3 because there is no 4th dimension to myArray2. In your example code, all of your arrays have to have the SAME number of dimensions or your code will error out as it is doing right now.
================================================== =========
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
|
|

February 16th, 2007, 12:55 PM
|
|
Authorized User
|
|
Join Date: Feb 2007
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
k i understand what u mean ...now my question is :
see i have a web application which allows the user to change arguments for certain directives in a config file .Now i want to be able to add these two options ... for example in this code
mthpyldsize default value is say 34000 34000 ..it should appear on the form and user should be able to change to any value ....so for that i guess i had to add to new arrarys which i just did by adding those 2 lines ...so how do i check whats the upper bound to these new lines ? plz advise.
|
|

February 16th, 2007, 01:55 PM
|
|
Wrox Author
|
|
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
|
|
Dim i
i = UBound(myArray)
That will give you an int value of the upper bound dimension of the supplied array.
================================================== =========
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
|
|

February 16th, 2007, 03:31 PM
|
|
Authorized User
|
|
Join Date: Feb 2007
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
I'm getting this error
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
Unknown column 'abcd' in 'field list'
/save_inc.asp, line 46
for i=0 to (sSim_num-1)
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_mthpyld size(i)&"','"&sSim_contype(i)&"')"
db_conn.execute(sql)
Plz help ....
|
|

February 16th, 2007, 03:32 PM
|
|
Wrox Author
|
|
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
|
|
Ok I am not going to solve this one for you and here is why: It is obvious that you are a beginner and need help and I don't mind helping people thats why i am here. Unfortunately, you are not going to learn anything if I keep solving your problems and, to quote woodyz from one of his posts, "Experience is what makes you an expert".
Part of the expereince is dealing with the ASP Interperter and figuring out what it is telling you and, in your example it is telling you that it is expecting an end of statement so figure it out!. Here is a hint: check to make sure all of your & ' and " are in their correct places.
================================================== =========
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
|
|
 |