C
Csharp?
Hello All
I am lost in Vbscript and can not find the proper support group. I hope
anyone of you who knows Vbscrip well will help me. I am trying to use
GetDataType function to extract recordsets data and return an array of
records by calling function GetDataType. My code is listed as follows. I
would like to substitute GetDataType1 with GetDataType, However, I got error
message. Basically, I want to know how to make a function return an array of
data. Please help.....
-- Function GetDataType()
Dim NumberOfDataType
Dim GetDataType1
const adOpenKeyset = 1
const adLockOptimistic = 3
dbpath = "C:\Base.mdb"
SQL2 = "SELECT Data_Types FROM CATALOG_DATA_TYPES;"
set conn=CreateObject("ADODB.Connection")
conn.Provider="Microsoft.Jet.OLEDB.4.0"
conn.Open dbpath
Set dst5 = CreateObject("ADODB.Recordset")
dst5.Open SQL2, conn, adOpenKeyset, adLockOptimistic
NumberOfDataType = dst5.RecordCount
redim GetDataType1(NumberOfDataType-1,0)
If Err.Number <> 0 Then
Response.Write("There was an error processing your request.<br>Please try
again.")
Exit Function
Else
If dst5.EOF and dst5.BOF Then
Response.Write("There are currently no records returned.")
Exit Function
Else
GetDataType1 = dst5.GetRows(9,0)
End If
End If
dst5.Close
conn.Close
Set dst5 = Nothing
set conn = Nothing
End Function
Csharp?
I am lost in Vbscript and can not find the proper support group. I hope
anyone of you who knows Vbscrip well will help me. I am trying to use
GetDataType function to extract recordsets data and return an array of
records by calling function GetDataType. My code is listed as follows. I
would like to substitute GetDataType1 with GetDataType, However, I got error
message. Basically, I want to know how to make a function return an array of
data. Please help.....
-- Function GetDataType()
Dim NumberOfDataType
Dim GetDataType1
const adOpenKeyset = 1
const adLockOptimistic = 3
dbpath = "C:\Base.mdb"
SQL2 = "SELECT Data_Types FROM CATALOG_DATA_TYPES;"
set conn=CreateObject("ADODB.Connection")
conn.Provider="Microsoft.Jet.OLEDB.4.0"
conn.Open dbpath
Set dst5 = CreateObject("ADODB.Recordset")
dst5.Open SQL2, conn, adOpenKeyset, adLockOptimistic
NumberOfDataType = dst5.RecordCount
redim GetDataType1(NumberOfDataType-1,0)
If Err.Number <> 0 Then
Response.Write("There was an error processing your request.<br>Please try
again.")
Exit Function
Else
If dst5.EOF and dst5.BOF Then
Response.Write("There are currently no records returned.")
Exit Function
Else
GetDataType1 = dst5.GetRows(9,0)
End If
End If
dst5.Close
conn.Close
Set dst5 = Nothing
set conn = Nothing
End Function
Csharp?