QLearnerNow
Programmer
QLearnerNow (Programmer) Aug 26, 2003
Hi Guys,
I have created a recordset to a csv file. The csv file has an field called account number. some of the values in account number exceeds the integer data type capacity. The recordset retrieves these values as Nulls. How do I get around this problem.
Is there anyway I can read the input into the recordset as text???
Dim rsNav, ClientID, strSql
Dim rsNav_numRows
FileCleanse
Set rsNav = Server.CreateObject("ADODB.Recordset"
rsNav.ActiveConnection = MM_CMT_STRING
rsNav.Source = "SELECT * FROM NavigatorCleanse.csv Order By InvestorAccNum"
rsNav.CursorType = 0
rsNav.CursorLocation = 2
rsNav.LockType = 1
rsNav.Open()
rsNav_numRows = 0
thats my recordset
Response.Write rsNav("InvestorAccNum"
& " " & rsNav("InvestmentDescription"
& " " & rsNav("NumUnits"
& " " & rsNav("APIRCode"
& " " & rsNav("ASXCode"
& "<br>"
thats how I call it in a loop
if my csv file has a InvestAccNum value of 7890840000 it comes out as null as it exceeds the maximun int data type value. How do i set it to float or text?
rsNav("InvestorAccNum"
this is returning an int im not doing any conversion to int not using Cint anywhere. rsNav("InvestorAccNum"
just seems to come as an int.
im trying to use this statement now
rsNav.Source = "SELECT CAST(InvestorAccNum AS nvarchar)AS Acc FROM NavigatorCleanse.csv"
but I get this error
Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC Text Driver] Syntax error (missing operator) in query expression 'CAST(InvestorAccNum AS nvarchar)'.
I dont think we can use CAST with csv files
if anyone can help please let me know asap
Regards,
QLearnerNow
Hi Guys,
I have created a recordset to a csv file. The csv file has an field called account number. some of the values in account number exceeds the integer data type capacity. The recordset retrieves these values as Nulls. How do I get around this problem.
Is there anyway I can read the input into the recordset as text???
Dim rsNav, ClientID, strSql
Dim rsNav_numRows
FileCleanse
Set rsNav = Server.CreateObject("ADODB.Recordset"
rsNav.ActiveConnection = MM_CMT_STRING
rsNav.Source = "SELECT * FROM NavigatorCleanse.csv Order By InvestorAccNum"
rsNav.CursorType = 0
rsNav.CursorLocation = 2
rsNav.LockType = 1
rsNav.Open()
rsNav_numRows = 0
thats my recordset
Response.Write rsNav("InvestorAccNum"
thats how I call it in a loop
if my csv file has a InvestAccNum value of 7890840000 it comes out as null as it exceeds the maximun int data type value. How do i set it to float or text?
rsNav("InvestorAccNum"
this is returning an int im not doing any conversion to int not using Cint anywhere. rsNav("InvestorAccNum"
im trying to use this statement now
rsNav.Source = "SELECT CAST(InvestorAccNum AS nvarchar)AS Acc FROM NavigatorCleanse.csv"
but I get this error
Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC Text Driver] Syntax error (missing operator) in query expression 'CAST(InvestorAccNum AS nvarchar)'.
I dont think we can use CAST with csv files
if anyone can help please let me know asap
Regards,
QLearnerNow