Link to home
Start Free TrialLog in
Avatar of Wayne Barron
Wayne BarronFlag for United States of America

asked on

ASP Classic Multiple Row insert into Database no longer works.

Hello, All.

OK, what used to work, no longer work.
A multiple row insert, will now only, insert all into a single field.

environment: Windows 10 Pro / IIS
inserting into a Microsoft Office Access Database ACCDB
(This is a site for the intranet, and not for the internet. Which is the reason for using the access database)

Code, that used to work.

The form has all TEXTAREA's that are feeding into the insert form.

arrMN = Split(Request.Form("MediaName"), vbCrLf)  
arrMF = Split(Request.Form("MediaFile"), vbCrLf)  
arrMB = Split(Request.Form("MediaBand"), vbCrLf)  
 
for i=0 to uBound(arrMN)
  Set objDoubleInsert=CreateObject("ADODB.Command")  
  objDoubleInsert.ActiveConnection=objConn  
  objDoubleInsert.CommandText = "INSERT INTO EVMediaServer (MediaName, MediaFile, MediaBand) VALUES (?,?,?)"  
  objDoubleInsert.Parameters.Append objDoubleInsert.CreateParameter("@MediaName", 200, 1, 255, arrMN(i)) 
  objDoubleInsert.Parameters.Append objDoubleInsert.CreateParameter("@MediaFile", 200, 1, 255, arrMF(i))  
  objDoubleInsert.Parameters.Append objDoubleInsert.CreateParameter("@MediaBand", 200, 1, 255, arrMB(i))  
  objDoubleInsert.Execute  
Next

Open in new window


before, this code used to create as many rows as I had in the fields.
But now, all of it is inserted into ONE ROW, and all the lines are in one column.

What is going on?
Thanks for any and all assistance on this one.

Wayne
Avatar of Ryan Chong
Ryan Chong
Flag of Singapore image

before, this code used to create as many rows as I had in the fields.
But now, all of it is inserted into ONE ROW, and all the lines are in one column.

so you got:
for i=0 to uBound(arrMN)

Open in new window


try debug arrMN and uBound(arrMN)

it seems it cannot split with vbCrLf now ?
Avatar of Wayne Barron

ASKER

Hey, Ryan.
Could you please provide a little assistance on how to debug it?
ASKER CERTIFIED SOLUTION
Avatar of Ryan Chong
Ryan Chong
Flag of Singapore image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Honestly, I had forgotten all about this issue.
I will get back and let you know if this still exists or not.
(I wonder if this is the reason I stopped uploading files??? It could be, maybe it does still exist, but only on the development machine.
However, I have a new laptop, so maybe. I might need to check this code out again. As the code will be moved from the production server, it is on now, to a new one, here in a few weeks. As long as all goes right with setting up the server and getting them darn fans to quiet down some.)