Hi,
I have a form with a table with two fields SelectionID and Experience.
I am posting the data to a database using an array function. I have
set out the code below.
The problem I am having is where the Experience field is blank I get
an Microsoft OLE DB Provider for ODBC Drivers error '80040e21'. It
makes sense that a null value would cause the function problems.
I am sure that there is a very simple technique for getting around
this problem but so far my tinkering with the code hasn't come up with
it.
Any suggestions as to how to get around this would be much
appreciated.
With regards
Emmett Power
CODE
----
DIM arrSelectionID, arrExperience, i
DIM vrsSelection, Experience
DIM sqlString
Set objConn = Server.CreateOb ject("ADODB.Con nection")
ConnectionStrin g="DRIVER={Micr osoft Access Driver (*.mdb)}; DBQ=" &
Server.MapPath( "../../fpdb/Database.mdb")
objConn.Open ConnectionStrin g
arrSelectionID= split(request(" SelectionID")," ,")
arrExperience= split(request(" Experience"),", ")
for i = 0 to ubound(arrSelec tionID)
vrsSelectionID = arrSelectionID( i)
vrsExperience = arrExperience(i )
sqlString = "UPDATE Selection SET
Experience='"&T rim(vrsExperien ce)&"' WHERE SelectionID
="&vrsSelection ID&""
objConn.Execute (sqlString)
next
%>
I have a form with a table with two fields SelectionID and Experience.
I am posting the data to a database using an array function. I have
set out the code below.
The problem I am having is where the Experience field is blank I get
an Microsoft OLE DB Provider for ODBC Drivers error '80040e21'. It
makes sense that a null value would cause the function problems.
I am sure that there is a very simple technique for getting around
this problem but so far my tinkering with the code hasn't come up with
it.
Any suggestions as to how to get around this would be much
appreciated.
With regards
Emmett Power
CODE
----
DIM arrSelectionID, arrExperience, i
DIM vrsSelection, Experience
DIM sqlString
Set objConn = Server.CreateOb ject("ADODB.Con nection")
ConnectionStrin g="DRIVER={Micr osoft Access Driver (*.mdb)}; DBQ=" &
Server.MapPath( "../../fpdb/Database.mdb")
objConn.Open ConnectionStrin g
arrSelectionID= split(request(" SelectionID")," ,")
arrExperience= split(request(" Experience"),", ")
for i = 0 to ubound(arrSelec tionID)
vrsSelectionID = arrSelectionID( i)
vrsExperience = arrExperience(i )
sqlString = "UPDATE Selection SET
Experience='"&T rim(vrsExperien ce)&"' WHERE SelectionID
="&vrsSelection ID&""
objConn.Execute (sqlString)
next
%>
Comment