Emre5134 Posted October 11, 2008 Report Share Posted October 11, 2008 Hi everyone, I'm working on a little program which will insert aircraft's current latitude and longtitude to a mysql database. I am using visual basic 6. In VB I get the position data from FSUIPC as DOUBLE data type. But when I try to insert these data to the database I get a type missmatch error. The data types in mysql are DOUBLE as well. I also tried decimal and float in mysql but I got the same error message. What's the problem here? If anyone knows the answer I'd appreciate your help edit: I get the position from FSUIPC using these codes: Dim latitude as Double Dim longtitude as Double Dim FakeLat As Currency Dim FakeLon As Currency Dim dwResult As Long Call FSUIPC_Read(&H560, 8, VarPtr(FakeLat), dwResult) Call FSUIPC_Read(&H568, 8, VarPtr(FakeLon), dwResult) Call FSUIPC_Process(dwResult) latitude = FakeLat * 10000# latitude = latitude * 90# / (10001750# * 65536# * 65536#) longtitude = FakeLon * 10000# longtitude = longtitude * 360# / (65536# * 65536# * 65536# * 65536#) Thank you Link to comment Share on other sites More sharing options...
quantumleap Posted October 11, 2008 Report Share Posted October 11, 2008 You don't show the code or describe the method by which you are writing the data into the mySQL database. Any chance that it is accidently being written into it as a string? Jeff Link to comment Share on other sites More sharing options...
Emre5134 Posted October 11, 2008 Author Report Share Posted October 11, 2008 Ok I solved the problem.I tried to insert the value to the database using this sql: rs.open "insert into table(latitude,longtitude) values (" + latitude + "," + longtitude + ")",connection, adOpenStatic, adLockOptimistic I guess the problem was about the "+" symbols I used in the sql. I changed them with the "&" symbol and the problem is solved. Thank you Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now