|
||
Stack Trace:
|
Gone..
![]()
otaku |
Newbie
Joined: 01 June 2003 Location: Canada Status: Offline Points: 15
|
Post Options
Thanks(0)
Quote Reply
Posted: 14 September 2003 at 12:28pm
|
aUniqueId is a integer, not a string that's why you get "Data type mismatch" error message,
![]()
Diep-Vriezer |
Senior Member
Joined: 06 August 2003 Location: Netherlands Status: Offline Points: 831
|
Post Options
Thanks(0)
Quote Reply
Posted: 14 September 2003 at 3:07pm
|
Are you sure? The aUniqueId is a string wich I set before. But, I'll try and add .GetType.ToString after the aUniqueId.
|
Gone..
![]()
Diep-Vriezer |
Senior Member
Joined: 06 August 2003 Location: Netherlands Status: Offline Points: 831
|
Post Options
Thanks(0)
Quote Reply
Posted: 14 September 2003 at 3:08pm
|
|
Gone..
![]()
Diep-Vriezer |
Senior Member
Joined: 06 August 2003 Location: Netherlands Status: Offline Points: 831
|
Post Options
Thanks(0)
Quote Reply
Posted: 14 September 2003 at 3:15pm
|
O no! Exactly the same error.. This is my code: Public aIsLoggedin As Boolean, aIsIpBanned As Boolean, aIsAccountBanned As Boolean, aString As String Public Function CheckLoggedin(ByVal aUniqueId As String, ByVal cIp As String) Dim aConnection As OleDbConnection, aCommand As OleDbCommand, aDatareader As OleDbDataReaderaConnection = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\Pub\wwwroot1\Components\Databases\Account.mdb;User Id=admin;Password=;")aCommand = New OleDbCommand() With aCommand.CommandText = "SELECT * from tblLoggedin where Uid = '" & aUniqueId.GetType.ToString & "'" .CommandType = CommandType.Text .Connection = aConnection End WithaConnection.Open() aDatareader = aCommand.ExecuteReader() While aDatareader.ReadaString = aDatareader.GetString(1) End WhileaConnection.Close() End FunctionThe bold thing is where it all goes wrong... The aUniqueId exists in the database, and I want to retrieve the data of a column named Loggedin.
|
Gone..
![]()
otaku |
Newbie
Joined: 01 June 2003 Location: Canada Status: Offline Points: 15
|
Post Options
Thanks(0)
Quote Reply
Posted: 14 September 2003 at 4:19pm
|
Sorry I said aUniqueId, I wanted to say Uid is a integer If in your database Uid is an integer (as I think ): .CommandText = "SELECT * from tblLoggedin where Uid = " & aUniqueId But if in your database Uid is a String: .CommandText = "SELECT * from tblLoggedin where Uid = '" & aUniqueId & "'" ![]()
Diep-Vriezer |
Senior Member
Joined: 06 August 2003 Location: Netherlands Status: Offline Points: 831
|
Post Options
Thanks(0)
Quote Reply
Posted: 15 September 2003 at 12:09am
|
I got it now, well aUniqueId is an autonumber gererated by Acces, so I guess an Integer.
|
Gone..
![]()
|
|||||||||||||||||||||||||||||||||||||
|
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice
Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales. Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK. Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only. |