Data Conversion Error
DataControl (DAO) brings data from several fields into textboxes on the form. One of the fields is Number (Integer) data type. It's not Required, it's not Indexed. If it contains some value and user wants to delete that value by clearing a bound Text Box, then when the user wants to save that change by moving to the next or previous record, error saying "Data Conversion Error" occurs. Data can be deleted directly in the table with no problem. What I'm missing? What should I do in order to allow the user to update existing value to Null? This is an existing application, so altering it by replacing DataControl with Recordset is not acceptable (too much work related to replacing many other controls getting data from DataControl) Thank you Vlad
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Data Type Conversion Error. (Error 3421)
hi!! last time i had a problem this forum helped me a lot, so i´m here again...
See this:
Form2.Data1.DatabaseName = "passwords.xls"
Form2.Data1.RecordSource = "datos$"
Form2.Data1.Refresh
Form2.Data1.Recordset.AddNew
Form2.Data1.Recordset("Password") = p2.Text
Form2.Data1.Recordset.Update
This code gives me a 3421 error, since "p2.text" seems to have the wrong format... any ideas how i can get to run it...?
>>> thanks in advance
Data Type Conversion Error
Im getting runtime error 3421 "Data type conversion error", whilst executing this bit of code in Access 2000:
Dim rs As ADODB.Recordset
Dim connection As New ADODB.connection
Set rs = db.OpenRecordset("SELECT [ADDRESS] FROM [UNIFORM_PROPREC1] WHERE [UNIFORM_PROPREC1].[ADDRESS] like '" & Me.txtAddress.Text & "*'", connection, adOpenKeyset, adLockOptimistic)
Me.txtADDFind.Text = rs.Fields("ADDRESS")
The ADDRESS field in UNIFORM_PROPREC1 is a text datatype as is the me.txtAddress.text.
Any ideas? Is this code just fundamentally wrong ?!
Bag
Data Type Conversion Error
Hi, I am getting a "runtime error 524, data type conversion error" on a dbcombo. This has only happened since I have loaded msoffice'97 onto my computer. I am using visual basic 5. The all the other dbcombos in my program work fine except for this particular one. The program works fine with visual basic but when I compile and test it on the same machine, It brings up this error.
Also all the dbcombos are linked to 2 tables, 1 to populate the combo and the other is where the value is stored. It is only on the first field in the table where the problem is.
Also It is asking me for a dependency file for dblist32.ocx. Whould this be the problem as I can't find one.?
Can someone help me.
Data Type Conversion Error
i'm getting a data type conversion error with this code...can someone help?
Code:
With rstInfo
If .RecordCount = 0 Then
txtfname.SetFocus
Exit Sub
End If
Dim Counter As Integer
Counter = 0
.MoveFirst
.OpenRecordset ("select * from repairtable where custfName = " & "'" & lstlookup.SelectedItem.Text & "'")
Call update_form
End With
this code is inside a lst double click event. the update form just puts the text from the table to the textboxes. On debug the code lights up...
.OpenRecordset ("select * from repairtable where custfName = " & "'" & lstlookup.SelectedItem.Text & "'")
Data Type Conversion Error
i'm getting the error on this code
VB Code:
With rstInfo If .RecordCount = 0 Then txtfname.SetFocus Exit Sub End If Dim Counter As Integer Counter = 0 .MoveFirst .OpenRecordset ("select * from repairtable where custfName = " & "'" & lstlookup.SelectedItem.Text & "'") Call update_form End With
the error seems to be with this code...
VB Code:
.OpenRecordset ("select * from repairtable where custfName = " & "'" & lstlookup.SelectedItem.Text & "'")
Data Type Conversion Error?
Why do I get this error.
It happens when I click the arrow on the data1. And when I click break on all errors it doesnt break. It just says datatype conversion error. And it doesnt tell me what line the error is. Here is all of my code:
VB Code:
Option Explicit Private Sub Command1_Click()Text5.Text = Val(Text5.Text) + 1Text3.SelText = Date & ", "Text8.Text = Date & ", "End Sub Private Sub Command2_Click()On Error GoTo errorhandler Me.Data1.Recordset.FindFirst "[ID] = """ + Text7 + """""" Text1 = rs("ID") Text2 = rs("Student") Text3 = rs("All Lunch Detentions") Text4 = rs("Home Room") Text5 = rs("# Of Detentions") Text6 = rs("Home Phone") Text8 = rs("Detention Date") rs.Close cn.CloseExit Suberrorhandler:MsgBox "Student not found according to search criteria.", vbInformation, "Invalid Search Criteria"End SubPrivate Sub Form_Load()Data1.DatabaseName = App.Path & "ld(converted).mdb"End Sub Private Sub mnuexit_Click()Unload MefrmDataBaseViewer.ShowEnd Sub
Data Type Conversion Error
Hi,
I have a date/Time field (Required = No) in my database. Whenever I try to update this field with an empty value, an error message say "Data type conversion error" appears.
Table.Addnew
Table!Date = "" <---------------------
Table.Update
Table.Close
Can anyone help me to resolve this problem?
Thank you very much.
DBGrid And Error Data Conversion
Hi,
I use dbgrid with num value. When I wont to delete value one cell and change de active cell, I receive an eroor like "Error data conversion"
But...When I put the break point in my code (in this sub)
---------------------
Private Sub DBGrid1_KeyUp(KeyCode As Integer, Shift As Integer)
If KeyCode = 46 Or KeyCode = 8 Then ' the 46 = delete and 8 = backspace
DBGrid1.Text = Null
Else
End If
End Sub
--------------------
And after that I change the active cell and I don't receive the error.
But I don't want to run my programme all the time with a break point.
Some body can help me?
Thanks
Régis
Data Type Conversion Error In ComboBox
Hey there,
I have a combobox in my form that is connected with a field in a table. Then everytime there is a movement in the DBGrid1 (also connected to the table), I tell the program that it has to change the combobox content. I do that because sometimes the field connected to combobox have nothing and it's a manner to force a default value to this field, when user is navegating through the table. What I mean is, if the field is empty, the first time someone pass by that record the value of the field will be setted to 1 (default). Well, this is my idea, but I can't do that because whenever there is a movement in the DBGrid1, VB returns a "Data Type Conversion error".
Let's see the facts:
The combobox info (properties window):
Name = cmbCliTipo
Datafield = clitipo
Datasource = cliente
Itemdata = 0 1 2 (one on another)
List = Loja Vendedor Crédito (one on another)
The field clitipo is an integer.
My code is:
Code:
Private Sub DBGrid1_rowcolchange(LastRow As Variant, ByVal LastCol As Integer)
If Cliente.Recordset.CliTipo = 0 Then
cmbCliTipo.ListIndex = 0
ElseIf Cliente.Recordset.CliTipo = 1 Then
cmbCliTipo.ListIndex = 1
ElseIf Cliente.Recordset.CliTipo = 2 Then
cmbCliTipo.ListIndex = 2
Else
cmbCliTipo.ListIndex = 0
End If
End Sub
I would be very grateful if someone can help me to know what's wrong. I know it's a stupid question, but, in fact, believe it or not, I have the VB 6 Little Black Book (Steven Holzner) and I have browsing through the net and I have not found anywhere a combobox setting cakewalk...
Thanks in advance!
3421: Data Type Conversion Error
Hi all,
I have database related problem. I make a access database password protected. I am trying to access the database. But I am getting the error,
Run-time error 3421
Data typeconversion error.
Following is my code.
[vb code]
Dim I As Long
Set myset = OpenDatabase(App.Path & "mydata.mdb", "ffshh84151561yuy").OpenRecordset("mytable", dbOpenDynaset)
If myset.RecordCount <> 0 Then
myset.MoveFirst
For I = 0 To myset.RecordCount - 1
display
Next
Else
Clear
End If
[vb code]
Please help me to cope up with the situation.
***RESOLVED*** Data Type Conversion Error
I need to be able to divide two currency values in an MSFlexGrid to come up with a percent value.
The challenge is that I need to have error handling to be sure that if the user puts in a $.0 currency value I do not get an error.
Ex.
Private Sub MSFlexGrid1_LeaveCell()
With MSFlexGrid1
.TextMatrix(1, 1) = Format(.TextMatrix(2, 1) / .TextMatrix(3, 1), "0.0%")
End With
End Sub
SQL Error: Char Data Type Conversion To Datetime Data Type Error
I created an application which, in one instance, queries an
SQL Server 7 table based on a date entered.
I have installed it on 4 machines (one NT, two 98 & one 95).
It works fine on all but one of the 98 machines.
On this !one! machine I receive the following error:
Error 2147217913 was generated by Microsoft OLE DB provider
for SQL Server The conversion of a char data type to a
datetime data type resulted in an out-of-range datetime
value.
I get the date from a datepicker with the format
"dd/MMM/yyy HH:mm:ss"
Help!
Thanks in advance
Need Response ASAP! Data Type Conversion Error
Our requirement is: User should be able to enter the no value in the datetime field in our case
it is time in the format HH:MM hours:minutes and still the database should store that value as
blank and no other value not even as 0:00.
In MS-Access 97 SR-2 we have table 'T' with datetime datatype field 'F'. We have a query 'Q'
defined on this table to insert record into this table 'T'. We are executing this query 'Q' from
Visual Basic 6.0 and our application requirement is such that user may sometimes not enter any
value in the date field and still the insert query should work.
Here is my query in MS-Access:
Select query:
--------------
SELECT reptime
FROM table1
WHERE id=8;
Insert query:
-------------
PARAMETERS preptime DateTime;
INSERT INTO table1 ( reptime )
SELECT preptime;
Here is my Table definition:
Name:table1
Fields Datatype
idAutonumber
reptimedate/time (short time format)
Here is the code from Visual Basic which gives error as "Data type conversion error":
Private Sub Command1_Click()
Dim db As Database
Dim qd As QueryDef
Dim rs As Recordset
Set db = OpenDatabase("d:personalira.mdb")
Set rs = db.OpenRecordset("table1")
Set qd = db.QueryDefs("insert")
With qd
.Parameters("Preptime") = vbNull
.Execute
End With
Set qd = db.QueryDefs("select")
Set rs = db.OpenRecordset("select")
'rs!RepTime = MaskEdBox1.Text
Text1.Text = rs!RepTime
'rs.Update
End Sub
Problem: When we are exceuting this query using QueryDef from VB application we are getting "data
type conversion error" message. When we did little investigation we found that, when VB is trying
to send some empty string to this date field in MS-Access Database doesn't accept any empty
string.
Here are the options I have tried?
1. When I tried to pass a Null value to the date field in the database when there is no value
entered in this date form variable. MS-Access table is storing that date value as 0:00 which is
no good because user treats it as valid time value.
2. When I tried to execute the query inside the MS-access by passing no value to this date value
it was accepting and the date value is stored as blank but same is not true when I am trying to
sent the blank date value from VB.
Is there any solution for this?
How To Retrieve Ms Excell Data (sheet Name) To Sql Table Using Vb (Data Conversion)
hi
i have problem to retrieve a ms excell data to sql table (i'am using sql 2000) using visual basic.
then another problem is after the conversion process, how to retrieve the certain sql field (example name field) and
make it into shortname (example robert joseph to robert) without adding the last name and update it into sql table.
my limitation for the shortname is 12 character.
plss help me
Data Conversion
Well, our company had to contract some work out to a java developer for a Cell phone app that returns to our server the Latitude, longitude and Time that the data was taken from the phone. the Cell the sends the data to our server & we plot the coordinates.
The cell is supposed to return this:
1st 8 bytes (Latitude)
2nd 8 bytes (longitude)
3rd 8 bytes (Timestamp)
anyways, I’ve fiddled with the data and can't get the date of ~05/10/04 11:27 PM~
and yet alone the Lat. & long. cords that are approximately around where the Cell was.
Any help (w/ code snippets) would be great.
Bellow is the asc value of the data, separated by a comma.
0,0,0,0 14,46,158,0 255,255,255,255 218,107,65,128 0,0,0,252 110,226,73,180
just so we are looking at the same data here is some code
Code:
Dim iStr As String * 24
Dim i&, iArray$()
iArray = Split("0,0,0,0,14,46,158,0,255,255,255,255,218,107,65,128,0,0,0,252,110,226,73,180", ",")
For i = LBound(iArray) To UBound(iArray)
Mid(iStr, i + 1, 1) = Chr(iArray(i))
Next
Open "C:GPSData.dat" For Binary As FreeFile
Put #(FreeFile - 1), , iStr$
Close #(FreeFile - 1)
Debug.Print iStr$
Data Conversion
Hi,
dose anyone know how to resolve in crystal an of the bugs.
I am conected to multiple tables via ODBC.
in crystal reports i did use the visual data manager to creat the relationships. and the fields are there. so far all this is working.
the problem is i have in two diferent tables fields with the same name but diferent data. and the one is the data on which the criteria is filtering. as i hav it right now the data from the primary field is shoving instat of the data from the field if i brows the data it shows the corect one.
Data Conversion
Hi,
dose anyone know how to resolve in crystal an of the bugs.
I am conected to multiple tables via ODBC.
in crystal reports i did use the visual data manager to creat the relationships. and the fields are there. so far all this is working.
the problem is i have in two diferent tables fields with the same name but diferent data. and the one is the data on which the criteria is filtering. as i hav it right now the data from the primary field is shoving instat of the data from the field if i brows the data it shows the corect one.
Data Conversion
HI All
Does any one know how to convert a binary file into a readable (by human)
file? Its from a bin file, has addresses and stuff which I can work out...
but how do you do the actual conversion?
--
Regards
Dillon Mantle
Different Angle Solutions
072 300 0206
Conversion Error
Hi,
I get the following error message:
"Conversion error occurred while building parameterized update or refresh statement."
when I use the UpdateBatch ADO method. Has anyone faced this error message before? Please help!!!
Thanks, Lior
Data Type Conversion
i want to convert the datatype from string to double is there any way to do it i am doing as below
dim vv as string
dim k as double
vv = "0.0012"
k=cdbl(vv)
but it gives type mismatch error
how can i retrive the value from string
Does ADO Do Automatic Data Conversion In VB?
HI:
I am just wondering if ADO actually does automatic data type conversion in visual basic 6.0
what i meant is the following
let us say we have a function called
public function updateField(String name, Variant value){
rs.getField(name).setValue(value);
rs.update();
now do i have to cast value to the type that is consistent with the field?
please let me know
thanks
Data Type Conversion
hi how can i convert a data type using sql for example
Select * from Table where number = '123'
how can i convert the field number to string in access. is this possible in access coz in oracle it is posible. thanks
Data Conversion Prob
I am currently working on implementing a Encryption-Decryption Prog:
Encryption Form:
->Plain Text converted to Ascii form using StrConv(plain, vbFromUnicode)
->Encryption carried out after padding
->Cipher Text converted to Unicode using StrConv(str, vbUnicode)
Decryption Form
->The above Cipher Text converted to Ascii form using
StrConv(cipher,vbUnicode) (Prob: DATA LOSS HERE! )
->Decryption carried out + Unpadding
->Plain Text converted to Unicode.
Does the StrConv function really cause data loss?
I removed the last step of 1st form & 1st step of the 2nd forms ..ie took the cipher text data in ascii form itself & there was no data loss then. Finally i got the Decrypted plain text to match the original data.
The VB program allows the user to encrypt as well as decrypt or test the encryption also.
The user might take cipher data from a text file itself. Hence the decryption prog should be able to operate on its own & cant expect data to always be in ascii form
So my question is: How do i carry out Unicode to Ascii conversion without data loss?
Or the only way is to make output of Encryption = Hex or binary form
Data Conversion Function
Hi all, i want to know that is there a exist function to convert the hexadecimal number to ASCII text character directly.
Eg: data string "48656C6C3020313233", now i want to convert the hexadecimal data string to ASCII text "Hello 123" after i click a command button.
So how can i implement this just by using the conversion function? Thanks in advance!
String Data Conversion
Hi all,
i have to convert a long input data string now, the format of the string is "...starting tag+...+ending tag...starting tag+...+ending tag..." all the data in the string are hexadecimal number.
for example, starting tag is '1A', ending tag is '020D0A'. the sample string is :
3038301D0D0A451A20350A56890A2020020D0A30380A300D0C1A30450A89670A0A202046020D0A
As shown, there are 2 pairs of starting and ending tag, the others are data.
So now i need to use visual basic to detect the starting & ending tag pair and convert '1A' to '233123' and '020D0A' to '0235370D0A'.
the data '0A' between the starting and ending tag are also need to convert accordingly, the first '0A' change to '233223' ;second '0A'to '233323' ,third '0A' to '233423'...etc ,the other data just copy over.
so the data string after conversion will be:
3038301D0D0A452331232035233223568923332320200235370D0A30380A300D0C233123304523322389762333232334232020460235370D0A
now i only be able to write the program to convert one pair of data, but i can't convert the data comes in more than one pair-like the sample above
so can you all help me? thanks a lot !
Image Data Conversion In VB6
Hi,
I need to read the Images from an Optical drive convert it to PDF file and save that into Oracle Database as BLOB. Total Images I need to read are arrond 500000. I am using Mircosoft Image Control and third party ocx controls such as
ImgAdmin, ImgEdit to read the image.
In this process I need to save the image to the local drive (reading from Optical drive) , convert to PDF and save into the database.
But while saving the image using Saveas () method, it required to display the image. This steps takes lot of time.
Does any one knows any other alternative to save as for saving the image.
I really need to speed up this process.
Any inputs will be highly appriciated..
Bhushan
Easy Data Conversion
Hi,
Does anyone know if there are functions in VB that can translate a float, long, single, double into an array of bytes representing the value and then back again? I know how to manually code the conversion, but that is an effort I would like to avoid if possible.
Thanks in advance
MechEngCoder
Help Wanted For Data Conversion
Hi All,
I have a problem regdg Data Type Conversion.
i have a string which has values like
str = "1","15.00","some string"
now i split it
str = Split(str, ",")
Set db = DBEngine(0)(0)
Set rstInfo = db.OpenRecordset("tbllInstructions")
With rstMullInfo
.AddNew
!IntMulledQty = str(0)
!dblMullCharges = str(3)
!strInstructions = str(5)
!IntCounter = IntCount
.Update
End With
Out here when i try to insert the str(0) which has value "1" in the
Table column IntMulledQty , it gives me an error of Data type mismatch , since the coulmn is defined as an Number
but even if i try the CInt function , i get the same error.
How do i this ???
Any suggestions will be helpful.
himangi.
Data Conversion (a Tough One...)
Here we go:
I receive binary data from the serial port and have to convert them to decimal. No prob with Integer, BUT how can I convert an array of bytes to 4-byte-float or 8-byte-float(=Single or Double)?
When polling the MSCOMM, I know what to expect and which bytes in the string represent the number I'm interested in, but I don't know how to handle them.
Any help would be much appreciated!
Data Report Conversion To RTF
Help!
I used the DATA REPORT in all of my Visual Basic programs. Now I have a problem because the users want to save the yielded report to Rich Text Format (RTF). How can I do that... are available controls?
Pretty please!
Aelan
MSComm Data Conversion
I have been banging my head against several walls for hours!!!
I have a data logger that is sending binary data to the PC. When the data sent is ascii text ( i.e. $45) VB interprets it just fine and display the letter. However, what I need is for the logger to send 10 bytes of data, each byte is a number between 0 and 255. I need to display this value as text in a textbox.
When I recieve this data and try to display it in text mode, I get nothing. Using StrConv to move the data to Unicode doesn't help.
If MSComm is set to "comInputModebinary" each number is dispayed as a "?". VB will not allow for the casting of a 1 char string to an int (so I could do the conversion myself).
I am reading the whole input buffer, all 10 bytes, into a string, VBdidn't like trying to throw it into an array, I tried a binary array.
REmember, the data being sent is in a binary number form, I need to take this binary number, 0-255, and convert it into "0"-"255".
Thanks in advance!!!
-nick
Data Type Conversion In SQL
I have 2 tables in SQL server as below,
Table1:
T1Col1 --- numeric(9,2)
T1Col2 --- varchar(3)
Table2:
T2Col1 --- varchar(5)
T2Col2 --- varchar(3)
Due to some reason, I need to union the two table, ie
Code: (SELECT * FROM TABLE1) UNION ALL (SELECT * FROM TABLE2)
However, as you notice, the first column of the two tables are of different data type. Can I change the first column of Table1 to varchar in the selection statment, so that the definition of table 1 remains the same?
Data Type Conversion
Hi,
how can I convert data stored in a 4 byte array (written by a VC++ programs from a float data type) in a VB Single data type?
Something just like the following (for Long data type)...
Public Function CByteArrToLong(buff() As Byte) As Long
Dim TempLong As Long
Call CopyMemory(TempLong, buff(LBound(buff)), 4)
CByteArrToLong = TempLong
End Function
thks all.
Marcello
Data Conversion Blues!
Hi,
I have a table called teacher which has two fields: 1) teacherid (autoincrement) and fname (text).
I have a form which has a combobox called combo1 and a textbox called text1.
When the form loads, the connection is made and the combobox has all the data from teacherID filed.
Now I want that if I coose 1 teacherID from the comboboc, the corrosponding teacher name (fname) should be displayed in the textbox.
I have this following code which gives me type mismatch error:-
sql = "select * from teacher where teacherid='" & CInt(Combo1.Text) & "'"
rs.Open sql, conn
Text1.Text = rs!fname
Where am I wrong?
Please help.
Data Conversion Problem
Hi All,
I am new to My SQL. I am truing to convert a database from My SQL to access. All I require to do this is have the data in a .csv format. I have the data dump from the MySQL database as a .sql file. Is there ay way I can convert this .sql file to a .csv?
Thanks,
Ben
OLE DATA Type Conversion
Hi,
Murli here,
I would like to help me someone that,
How? using access db fields(OLE/Object-Microsoft Equation 3.0 editor) i.e. math equations, store and retrive and editing it through VB6 Programming?
Thanking you!
Murli Gawali
Date Conversion Error
When I am trying to extract some data from SQL for a particular date it gives me an error saying that " Conversion resulted in out-of-range value...
How can I solve this .. ?
Error Of Datatype Conversion?
Another trouble in VB / SQL Server. I keep getting the error message:
'Error converting datatype varchar to bigint.
I'm not sure why I'm getting this error since it seems I have the correct command object anmd the sproc. Here is my command object:
VB Code:
Set objCmd = New ADODB.Command With objCmd.ActiveConnection = objConn.CommandText = "update_proposal_by_proposalid" 'our stored procedure is good_login.CommandType = adCmdStoredProc 'its a stored procedure.Parameters.Append .CreateParameter("ProposalID", adBigInt, adParamInput, , Me.txtProposalID.Text).Parameters.Append .CreateParameter("CustomerID", adBigInt, adParamInput, , cboCustomers.ItemData(cboCustomers.ListIndex)).Parameters.Append .CreateParameter("SiteID", adBigInt, adParamInput, , cboSites.ItemData(cboSites.ListIndex)) If (cboCommissions.ListIndex) > -1 Then.Parameters.Append .CreateParameter("CommissionID", adBigInt, adParamInput, , cboCommissions.ItemData(cboCommissions.ListIndex))Else'.Parameters.Append .CreateParameter("CommissionID", adBigInt, adParamInput, , 0)End If If (cboCostUnits.ListIndex) > -1 Then.Parameters.Append .CreateParameter("CostUnitID", adBigInt, adParamInput, , cboCostUnits.ItemData(cboCostUnits.ListIndex))Else'.Parameters.Append .CreateParameter("CostUnitID", adBigInt, adParamInput, , 0)End If .Parameters.Append .CreateParameter("Originator", adVarChar, adParamInput, 30, Me.txtOriginator.Text).Parameters.Append .CreateParameter("OpenDate", adDate, adParamInput, , Me.txtOpenDate).Parameters.Append .CreateParameter("DueDate", adDate, adParamInput, , Me.txtDesiredShipDate).Parameters.Append .CreateParameter("DeliveryDate", adDate, adParamInput, , Me.txtExpectedDeliveryDate) If (cboCountry.ListIndex) > -1 Then.Parameters.Append .CreateParameter("CountryID", adBigInt, adParamInput, , cboCountry.ItemData(cboCountry.ListIndex))Else.Parameters.Append .CreateParameter("CountryID", adBigInt, adParamInput, , 0)End If .Parameters.Append .CreateParameter("CustomerRFQ", adVarChar, adParamInput, 50, Me.txtRFQ.Text).Parameters.Append .CreateParameter("RevLevel", adTinyInt, adParamInput, , Me.txtVersion.Text).Parameters.Append .CreateParameter("SystemDescription", adLongVarChar, adParamInput, SizeOfSQLText, Me.txtSystemDescription.Text).Parameters.Append .CreateParameter("AdditionalInfo", adLongVarChar, adParamInput, SizeOfSQLText, Me.txtAdditionalInfo.Text) If Me.optAccepted.Value = True Then.Parameters.Append .CreateParameter("ProposalStatus", adTinyInt, adParamInput, , Me.optAccepted.Tag)ElseIf Me.optDeclined.Value = True Then.Parameters.Append .CreateParameter("ProposalStatus", adTinyInt, adParamInput, , Me.optDeclined.Tag)Else.Parameters.Append .CreateParameter("ProposalStatus", adTinyInt, adParamInput, , Me.optPending.Tag)End If.Parameters.Append .CreateParameter("ModifiedBy", adVarChar, adParamInput, 30, GetName()).Parameters.Append .CreateParameter("ModifiedOn", adDate, adParamInput, , Now()).ExecuteEnd With
And here is my sproc
Code:
CREATE PROC update_proposal_by_proposalid @ProposalID bigint, @CustomerID bigint, @SiteID bigint, @CommissionID bigint, @CostUnitID bigint, @Originator varchar(30), @OpenDate datetime, @DueDate datetime, @DeliveryDate datetime, @CountryID bigint, @CustomerRFQ varchar(50), @RevLevel tinyint, @SystemDescription text=NULL, @AdditionalInfo text=NULL, @ProposalStatus tinyint, @ModifiedBy varchar(30), @ModifiedOn datetime
AS
BEGIN
SET NOCOUNT ON
UPDATE Proposals SET Proposals.CustomerID=@CustomerID, Proposals.SiteID=@SiteID, Proposals.CommissionID=@CommissionID, Proposals.CostUnitID= @CostUnitID, Proposals.Originator=@Originator, Proposals.OpenDate=@OpenDate, Proposals.DueDate=@DueDate, Proposals.DeliveryDate=@DeliveryDate, Proposals.CountryID= @CountryID, Proposals.CustomerRFQ= @CustomerRFQ, Proposals.RevLevel=@RevLevel, Proposals.SystemDescription=@SystemDescription, Proposals.AdditionalInfo=@AdditionalInfo, Proposals.ProposalStatus=@ProposalStatus, Proposals.ModifiedBy= @ModifiedBy, Proposals.ModifiedOn= @ModifiedOn
WHERE Proposals.ProposalID=@ProposalID
SET NOCOUNT OFF
END
GO
Can anyone look at this...
Jon
Conversion Error In Datagrid
Hi all,
I have a datagrid whose property is set to allow updates. One of the fields
this grid displays is a numeric field. When a record is edited I get the
error:
Error converting datatype varchar to numeric
How can I correct this?
SQL Server - The Conversion Of A Char Data Type To A Datetime Data Type Resulted.....
Hi All
I have developed an application with vb6.0 and sql server 2000 database and working well on my desktop.
While client saving records in db, sometimes they are getting following error.
"The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value."
I'm using ADOs and code like this...
rstCustomer("joindate") = mskJoinDate
rstCustomer("jointime") = mskJoinTime
rstCustomer.Update
' Here mskJoinDate is maskedit control, contains date in dd/mm/yyyy format only.
' Here mskJoinTime is maskedit control, contains Time in hh:mm format only.
' Both are datetime fields in database.
' These two fields won't contain any other data because I have done perfect validation before assign values to recordset.
Anybody have idea about my problem? Please help me to solve this.
Thanks in advance
Pradeep
Conversion Of Data From MS Word To Access
A MS Word form with 30 items has been created. Some of the items will be converted into MS Access. I would like to ask if this can be done with just 1-2 steps by writing some VBA/Marco and Could anyone please kindly provide me the scripts.
Many many thanks.
Allowed Data Type Conversion
I am very confused by this one, so let me know if what I say is difficult to understand.
The following is the code I am crashing on (occaisionally):
<cfquery name="eqptotal" datasource="login">
select sum(total) as eqptot
FROM budget, team
where userid = #userid#
and reqtype = '#equipment#'
and coach = #coach#
and team.teamname=budget.sport
and not itemorder=3
</cfquery>
<cfquery datasource="login" name="ship">
select shipcost
from ship
</cfquery>
<cfset eqpship = eqptotal.eqptot * ship.shipcost>
<cfset eqpestTot = eqptotal.eqptot + eqpship>
I get the following message regarding the
"<cfset eqpship = eqptotal.eqptot * ship.shipcost>"
Cannot convert to number.
Please, check the ColdFusion manual for the allowed conversions between data types
eqptotal.eqptot is the total of a field named 'total' ( it holds singles)
ship.shipcost is equal to a field named 'ship' (it also holds singles)
I am using MS Access
To further confuse me the code works for some users but not all????
Decimal Data Type Conversion
I want to convert 23.43535353 to 23.44 like this in VB6.
Can any body help me in this regards.
Thanks in advance.
Polash
Data Format Conversion Routine
I am connecting to a device that provides string output in IEEE single and
double precision formats. I need to convert them to single and double in
VB6. Anyone know of any API calls or OCX's available or actual source code
to do this.
Thanks in advance for any help
Word To Text Conversion Error
I've been trying to write some code that will open a word document and get the text from the line that has the string "LastName" in it. The problem is that somehow when I get the text from the Word file the carriage returns get converted into something other than a carriage return or else my Split funtion isn't working correctly. What ends up happening is that the Split function doesn't split the document at all. Please let me know what the problem is and how I can fix it. Thanks
Private Sub Command1_Click()
Dim objApp As Object
Dim objDoc As Object
Dim tempLine As String
Dim wholeDoc As String
Set objApp = CreateObject("Word.Application")
Set objDoc = objApp.Documents.Open("d:TEMPTest.doc")
wholeDoc = objDoc.Range.Text
objDoc.Close
Set objDoc = Nothing
objApp.Quit
Set objApp = Nothing
Dim currLine As Integer
Dim searchString As String
currLine = 0
Dim Lines 'this will be split into an array on the next line
'*****************************
Lines = Split(wholeDoc, vbCrLf)
'*****************************
Do While currLine <= (UBound(Lines)) 'while you haven't reached the last line
searchString = "LastName"
If (InStr(Lines(currLine), searchString) > 0) Then
'The searchString has been found and is in Lines(currLine)
Text2.Text = Lines(currLine) + "
"
End If
currLine = currLine + 1
Loop 'Do While currLine < UBound(Lines)
**********************
**********************
**********************
**********************
When I use a hex editor and paste the string text into a ascii file the suppossed carriage returns output as 0D which is the carriage return character as far as I know.
'OverFlow' Error With String Conversion.
Hi,
Very occasionally I get a runtime error, 'Overflow' from the following statement.
strTime = "Total Load Time:" + Str$(timeGetTime - stTot)
I am setting stTot to timeGetTime at the beginning of an operation, to time something, and its a global DIM as a Long.
The DEFINE for the timeGetTime is:
Public Declare Function timeGetTime Lib "winmm.dll" () As Long
I cant understand why this line would get an Overflow, since everything is 'Long'.
The operation normally takes around 10 secounds, so the difference (ie timeGetTime - stTot) should only be a small number anyway.
Thanks,
Rob D. ProIV Resource Centre www.proivrc.com
|