469,623 Members | 1,003 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,623 developers. It's quick & easy.

myodbc error

------=_NextPart_000_000D_01C35CF0.20AC1200
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

i get this msg:
Microsoft.Data.Odbc.OdbcException: NO_DATA - no error information =
available
at Microsoft.Data.Odbc.OdbcConnection.HandleError(Int Ptr hHandle, =
SQL_HANDLE hType, RETCODE retcode)
at Microsoft.Data.Odbc.OdbcDataReader.GetData(Int32 i, SQL_C sqlctype, =
Int32 cb)
at Microsoft.Data.Odbc.OdbcDataReader.internalGetStri ng(Int32 i)
at Microsoft.Data.Odbc.OdbcDataReader.GetValue(Int32 i, TypeMap typemap)
at Microsoft.Data.Odbc.OdbcDataReader.GetValue(Int32 i)
at Microsoft.Data.Odbc.DbCache.AccessIndex(Int32 i)
at Microsoft.Data.Odbc.OdbcDataReader.GetValue(Int32 i)
at Microsoft.Data.Odbc.OdbcDataReader.get_Item(String value)
at =
F=E6llesDialogbox.frmAddIngDialog.cboVaregruppe_Se lectedIndexChanged(Obje=
ct sender, EventArgs e) in C:\Documents and Settings\Administrator\My =
Documents\Visual Studio =
Projects\Datasystem\KS\F=E6llesDialogbox\frmAddIng Dialog.vb:line 357

then i try to get a row out fo the database mysql 3.23.54 run on redhat =
linux 9.0 i am acceessing it from vs.net via odbc.net.
i am using myodbc 3.51 and my code look like this:

Try
Dim plunr As Integer
Dim varenavn As String
Dim varegruppenr
Dim Ink=F8bspris
Dim Salgspris As String
Dim Engrospris As String
'Connector/ODBC 3.51 connection string
Dim MyConString As String =3D "DRIVER=3D{MySQL ODBC 3.51 =
Driver};" & _
"SERVER=3D" & =
System.Configuration.ConfigurationSettings.AppSett ings("Host") & _
";DATABASE=3D" & =
System.Configuration.ConfigurationSettings.AppSett ings("Database") & _
";UID=3D" & =
System.Configuration.ConfigurationSettings.AppSett ings("Username") & _
";Password=3D" & =
System.Configuration.ConfigurationSettings.AppSett ings("Password") & _
";"

'Connection
Dim MyConnection As New Odbc.OdbcConnection(MyConString)
MyConnection.Open()
Console.WriteLine("Connection State::" & =
MyConnection.State.ToString)
=20
Dim MyCommand As New Odbc.OdbcCommand()
MyCommand.CommandText =3D "SELECT * FROM Produkter where =
Varegruppe =3D '" & =
Replace(objVaregrupper(cboVaregruppe.SelectedIndex ).Groupnr, ",", ".") & =
"' order by Varenavn"
MyCommand.Connection =3D MyConnection
Dim MyDataReader As Odbc.OdbcDataReader
MyDataReader =3D MyCommand.ExecuteReader
While MyDataReader.Read
objProdukter(t) =3D New clsProdukter()
text +=3D " || "
objProdukter(t) =3D New clsProdukter()
plunr =3D MyDataReader("plunr")
varenavn =3D MyDataReader("Varenavn") =20
Ink=F8bspris =3D MyDataReader("Ink=F8bspris") 'it is =
here all the problems strarts even then i out comment this line =20
Salgspris =3D MyDataReader("Salgspris")
Engrospris =3D MyDataReader("Engrospris")
objProdukter(t) =3D New clsProdukter(CInt(plunr), =
varenavn, varegruppenr, CDbl(Ink=F8bspris), Salgspris, CDbl(Engrospris))
varegruppenr =3D =
objVaregrupper(cboVaregruppe.SelectedIndex)
text +=3D " ID =3D " & MyDataReader("Firmanr")
t +=3D 1
ReDim Preserve objProdukter(t)
End While
MyConnection.Close()
=20
Console.WriteLine("Connection State::" & =
MyConnection.State.ToString)

'Catch ODBC Exception
Catch MyOdbcException As Odbc.OdbcException
MsgBox(MyOdbcException.ToString)
Console.WriteLine(MyOdbcException.ToString)

'Catch program exception
Catch MyException As Exception
MsgBox(MyException.ToString)
End Try
cboProdukter.Items.Clear()
For t =3D 0 To UBound(objProdukter) - 1 Step 1
cboProdukter.Items.Add(objProdukter(t).Navn)
Next

and tis is my db

CREATE TABLE `Produkter` (
`ID` int(11) NOT NULL default '0',
`Plunr` double default NULL,
`Varenavn` varchar(255) default NULL,
`Varegruppe` decimal(10,3) default NULL,
`Varetext` varchar(255) default NULL,
`Firmanr` double default NULL,
`Firmavarenr` double default NULL,
`Ink=F8bspris` double NOT NULL default '0',
`Engrospris` double default NULL,
`Salgspris` varchar(255) default NULL,
`Tilbudspris` varchar(255) default NULL,
`Ern=E6ringID` varchar(255) default NULL,
`temp` varchar(255) default NULL
) TYPE=3DMyISAM;

#
# Data dump for tabellen `Produkter`
#

INSERT INTO `Produkter` (`ID`, `Plunr`, `Varenavn`, `Varegruppe`, =
`Varetext`, `Firmanr`, `Firmavarenr`, `Ink=F8bspris`, `Engrospris`, =
`Salgspris`, `Tilbudspris`, `Ern=E6ringID`, `temp`) VALUES (884, '9069', =
'Stegefl=E6sk, uden ben med sv=E6r', '07.300', '', '1', '0', '2', '2', =
'1,2,3,4,5,6,7,8,9,10', '1,2,3,4,5,6,7,8,9,11', '0929', '0');
INSERT INTO `Produkter` (`ID`, `Plunr`, `Varenavn`, `Varegruppe`, =
`Varetext`, `Firmanr`, `Firmavarenr`, `Ink=F8bspris`, `Engrospris`, =
`Salgspris`, `Tilbudspris`, `Ern=E6ringID`, `temp`) VALUES (883, '9026', =
'Fl=E6skeribs uden ben', '07.300', '', '1', '0', '2', '2', =
'1,2,3,4,5,6,7,8,9,10', '1,2,3,4,5,6,7,8,9,11', '0929', '0');
INSERT INTO `Produkter` (`ID`, `Plunr`, `Varenavn`, `Varegruppe`, =
`Varetext`, `Firmanr`, `Firmavarenr`, `Ink=F8bspris`, `Engrospris`, =
`Salgspris`, `Tilbudspris`, `Ern=E6ringID`, `temp`) VALUES (882, '9007', =
'Krydder Ribben', '07.300', '', '1', '0', '2', '2', =
'1,2,3,4,5,6,7,8,9,10', '1,2,3,4,5,6,7,8,9,11', '0374', '5');
INSERT INTO `Produkter` (`ID`, `Plunr`, `Varenavn`, `Varegruppe`, =
`Varetext`, `Firmanr`, `Firmavarenr`, `Ink=F8bspris`, `Engrospris`, =
`Salgspris`, `Tilbudspris`, `Ern=E6ringID`, `temp`) VALUES (881, '9067', =
'Ba Ribben', '07.300', '', '1', '0', '2', '2', '1,2,3,4,5,6,7,8,9,10', =
'1,2,3,4,5,6,7,8,9,11', '0374', '5');
INSERT INTO `Produkter` (`ID`, `Plunr`, `Varenavn`, `Varegruppe`, =
`Varetext`, `Firmanr`, `Firmavarenr`, `Ink=F8bspris`, `Engrospris`, =
`Salgspris`, `Tilbudspris`, `Ern=E6ringID`, `temp`) VALUES (880, '9111', =
'Forende', '07.300', '', '1', '0', '2', '2', '1,2,3,4,5,6,7,8,9,10', =
'1,2,3,4,5,6,7,8,9,11', NULL, NULL);
INSERT INTO `Produkter` (`ID`, `Plunr`, `Varenavn`, `Varegruppe`, =
`Varetext`, `Firmanr`, `Firmavarenr`, `Ink=F8bspris`, `Engrospris`, =
`Salgspris`, `Tilbudspris`, `Ern=E6ringID`, `temp`) VALUES (879, '9110', =
'Fedtnet', '07.300', '', '1', '0', '2', '2', '1,2,3,4,5,6,7,8,9,10', =
'1,2,3,4,5,6,7,8,9,11', NULL, NULL);
INSERT INTO `Produkter` (`ID`, `Plunr`, `Varenavn`, `Varegruppe`, =
`Varetext`, `Firmanr`, `Firmavarenr`, `Ink=F8bspris`, `Engrospris`, =
`Salgspris`, `Tilbudspris`, `Ern=E6ringID`, `temp`) VALUES (878, '9073', =
'Svinet=E6r', '07.300', '', '1', '0', '2', '2', '1,2,3,4,5,6,7,8,9,10', =
'1,2,3,4,5,6,7,8,9,11', NULL, NULL);
INSERT INTO `Produkter` (`ID`, `Plunr`, `Varenavn`, `Varegruppe`, =
`Varetext`, `Firmanr`, `Firmavarenr`, `Ink=F8bspris`, `Engrospris`, =
`Salgspris`, `Tilbudspris`, `Ern=E6ringID`, `temp`) VALUES (877, '9120', =
'Svinehovede med k=E6besnitte', '07.300', '', '1', '0', '2', '2', =
'1,2,3,4,5,6,7,8,9,10', '1,2,3,4,5,6,7,8,9,11', NULL, NULL);
INSERT INTO `Produkter` (`ID`, `Plunr`, `Varenavn`, `Varegruppe`, =
`Varetext`, `Firmanr`, `Firmavarenr`, `Ink=F8bspris`, `Engrospris`, =
`Salgspris`, `Tilbudspris`, `Ern=E6ringID`, `temp`) VALUES (876, '9129', =
'Skinker ( Hele)', '07.300', '', '1', '0', '2', '2', =
'1,2,3,4,5,6,7,8,9,10', '1,2,3,4,5,6,7,8,9,11', NULL, NULL);
INSERT INTO `Produkter` (`ID`, `Plunr`, `Varenavn`, `Varegruppe`, =
`Varetext`, `Firmanr`, `Firmavarenr`, `Ink=F8bspris`, `Engrospris`, =
`Salgspris`, `Tilbudspris`, `Ern=E6ringID`, `temp`) VALUES (875, '9132', =
'Sv=E6r uden fedt ( affald)', '07.300', '', '1', '0', '2', '2', =
'1,2,3,4,5,6,7,8,9,10', '1,2,3,4,5,6,7,8,9,11', NULL, NULL);

------=_NextPart_000_000D_01C35CF0.20AC1200--

Jul 19 '05 #1
2 2369
This is a known bug, there is a patch available at:
http://support.microsoft.com/default...b;en-us;319243

Or if you are using Visual Studio .NET 2003 use: System.Data.Odbc instead.

Brandon

"Kenneth Foli Jørgensen" <ke*****@lflug.dk> wrote in message
news:bh**********@FreeBSD.csie.NCTU.edu.tw...
------=_NextPart_000_000D_01C35CF0.20AC1200
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

i get this msg:
Microsoft.Data.Odbc.OdbcException: NO_DATA - no error information =
available
at Microsoft.Data.Odbc.OdbcConnection.HandleError(Int Ptr hHandle, =
SQL_HANDLE hType, RETCODE retcode)
at Microsoft.Data.Odbc.OdbcDataReader.GetData(Int32 i, SQL_C sqlctype, =
Int32 cb)
at Microsoft.Data.Odbc.OdbcDataReader.internalGetStri ng(Int32 i)
at Microsoft.Data.Odbc.OdbcDataReader.GetValue(Int32 i, TypeMap typemap)
at Microsoft.Data.Odbc.OdbcDataReader.GetValue(Int32 i)
at Microsoft.Data.Odbc.DbCache.AccessIndex(Int32 i)
at Microsoft.Data.Odbc.OdbcDataReader.GetValue(Int32 i)
at Microsoft.Data.Odbc.OdbcDataReader.get_Item(String value)
at =
F=E6llesDialogbox.frmAddIngDialog.cboVaregruppe_Se lectedIndexChanged(Obje=
ct sender, EventArgs e) in C:\Documents and Settings\Administrator\My =
Documents\Visual Studio =
Projects\Datasystem\KS\F=E6llesDialogbox\frmAddIng Dialog.vb:line 357

then i try to get a row out fo the database mysql 3.23.54 run on redhat =
linux 9.0 i am acceessing it from vs.net via odbc.net.
i am using myodbc 3.51 and my code look like this:

Try
Dim plunr As Integer
Dim varenavn As String
Dim varegruppenr
Dim Ink=F8bspris
Dim Salgspris As String
Dim Engrospris As String
'Connector/ODBC 3.51 connection string
Dim MyConString As String =3D "DRIVER=3D{MySQL ODBC 3.51 =
Driver};" & _
"SERVER=3D" & =
System.Configuration.ConfigurationSettings.AppSett ings("Host") & _
";DATABASE=3D" & =
System.Configuration.ConfigurationSettings.AppSett ings("Database") & _
";UID=3D" & =
System.Configuration.ConfigurationSettings.AppSett ings("Username") & _
";Password=3D" & =
System.Configuration.ConfigurationSettings.AppSett ings("Password") & _
";"

'Connection
Dim MyConnection As New Odbc.OdbcConnection(MyConString)
MyConnection.Open()
Console.WriteLine("Connection State::" & =
MyConnection.State.ToString)
=20
Dim MyCommand As New Odbc.OdbcCommand()
MyCommand.CommandText =3D "SELECT * FROM Produkter where =
Varegruppe =3D '" & =
Replace(objVaregrupper(cboVaregruppe.SelectedIndex ).Groupnr, ",", ".") & =
"' order by Varenavn"
MyCommand.Connection =3D MyConnection
Dim MyDataReader As Odbc.OdbcDataReader
MyDataReader =3D MyCommand.ExecuteReader
While MyDataReader.Read
objProdukter(t) =3D New clsProdukter()
text +=3D " || "
objProdukter(t) =3D New clsProdukter()
plunr =3D MyDataReader("plunr")
varenavn =3D MyDataReader("Varenavn") =20
Ink=F8bspris =3D MyDataReader("Ink=F8bspris") 'it is =
here all the problems strarts even then i out comment this line =20
Salgspris =3D MyDataReader("Salgspris")
Engrospris =3D MyDataReader("Engrospris")
objProdukter(t) =3D New clsProdukter(CInt(plunr), =
varenavn, varegruppenr, CDbl(Ink=F8bspris), Salgspris, CDbl(Engrospris))
varegruppenr =3D =
objVaregrupper(cboVaregruppe.SelectedIndex)
text +=3D " ID =3D " & MyDataReader("Firmanr")
t +=3D 1
ReDim Preserve objProdukter(t)
End While
MyConnection.Close()
=20
Console.WriteLine("Connection State::" & =
MyConnection.State.ToString)

'Catch ODBC Exception
Catch MyOdbcException As Odbc.OdbcException
MsgBox(MyOdbcException.ToString)
Console.WriteLine(MyOdbcException.ToString)

'Catch program exception
Catch MyException As Exception
MsgBox(MyException.ToString)
End Try
cboProdukter.Items.Clear()
For t =3D 0 To UBound(objProdukter) - 1 Step 1
cboProdukter.Items.Add(objProdukter(t).Navn)
Next

and tis is my db

CREATE TABLE `Produkter` (
`ID` int(11) NOT NULL default '0',
`Plunr` double default NULL,
`Varenavn` varchar(255) default NULL,
`Varegruppe` decimal(10,3) default NULL,
`Varetext` varchar(255) default NULL,
`Firmanr` double default NULL,
`Firmavarenr` double default NULL,
`Ink=F8bspris` double NOT NULL default '0',
`Engrospris` double default NULL,
`Salgspris` varchar(255) default NULL,
`Tilbudspris` varchar(255) default NULL,
`Ern=E6ringID` varchar(255) default NULL,
`temp` varchar(255) default NULL
) TYPE=3DMyISAM;

#
# Data dump for tabellen `Produkter`
#

INSERT INTO `Produkter` (`ID`, `Plunr`, `Varenavn`, `Varegruppe`, =
`Varetext`, `Firmanr`, `Firmavarenr`, `Ink=F8bspris`, `Engrospris`, =
`Salgspris`, `Tilbudspris`, `Ern=E6ringID`, `temp`) VALUES (884, '9069', =
'Stegefl=E6sk, uden ben med sv=E6r', '07.300', '', '1', '0', '2', '2', =
'1,2,3,4,5,6,7,8,9,10', '1,2,3,4,5,6,7,8,9,11', '0929', '0');
INSERT INTO `Produkter` (`ID`, `Plunr`, `Varenavn`, `Varegruppe`, =
`Varetext`, `Firmanr`, `Firmavarenr`, `Ink=F8bspris`, `Engrospris`, =
`Salgspris`, `Tilbudspris`, `Ern=E6ringID`, `temp`) VALUES (883, '9026', =
'Fl=E6skeribs uden ben', '07.300', '', '1', '0', '2', '2', =
'1,2,3,4,5,6,7,8,9,10', '1,2,3,4,5,6,7,8,9,11', '0929', '0');
INSERT INTO `Produkter` (`ID`, `Plunr`, `Varenavn`, `Varegruppe`, =
`Varetext`, `Firmanr`, `Firmavarenr`, `Ink=F8bspris`, `Engrospris`, =
`Salgspris`, `Tilbudspris`, `Ern=E6ringID`, `temp`) VALUES (882, '9007', =
'Krydder Ribben', '07.300', '', '1', '0', '2', '2', =
'1,2,3,4,5,6,7,8,9,10', '1,2,3,4,5,6,7,8,9,11', '0374', '5');
INSERT INTO `Produkter` (`ID`, `Plunr`, `Varenavn`, `Varegruppe`, =
`Varetext`, `Firmanr`, `Firmavarenr`, `Ink=F8bspris`, `Engrospris`, =
`Salgspris`, `Tilbudspris`, `Ern=E6ringID`, `temp`) VALUES (881, '9067', =
'Ba Ribben', '07.300', '', '1', '0', '2', '2', '1,2,3,4,5,6,7,8,9,10', =
'1,2,3,4,5,6,7,8,9,11', '0374', '5');
INSERT INTO `Produkter` (`ID`, `Plunr`, `Varenavn`, `Varegruppe`, =
`Varetext`, `Firmanr`, `Firmavarenr`, `Ink=F8bspris`, `Engrospris`, =
`Salgspris`, `Tilbudspris`, `Ern=E6ringID`, `temp`) VALUES (880, '9111', =
'Forende', '07.300', '', '1', '0', '2', '2', '1,2,3,4,5,6,7,8,9,10', =
'1,2,3,4,5,6,7,8,9,11', NULL, NULL);
INSERT INTO `Produkter` (`ID`, `Plunr`, `Varenavn`, `Varegruppe`, =
`Varetext`, `Firmanr`, `Firmavarenr`, `Ink=F8bspris`, `Engrospris`, =
`Salgspris`, `Tilbudspris`, `Ern=E6ringID`, `temp`) VALUES (879, '9110', =
'Fedtnet', '07.300', '', '1', '0', '2', '2', '1,2,3,4,5,6,7,8,9,10', =
'1,2,3,4,5,6,7,8,9,11', NULL, NULL);
INSERT INTO `Produkter` (`ID`, `Plunr`, `Varenavn`, `Varegruppe`, =
`Varetext`, `Firmanr`, `Firmavarenr`, `Ink=F8bspris`, `Engrospris`, =
`Salgspris`, `Tilbudspris`, `Ern=E6ringID`, `temp`) VALUES (878, '9073', =
'Svinet=E6r', '07.300', '', '1', '0', '2', '2', '1,2,3,4,5,6,7,8,9,10', =
'1,2,3,4,5,6,7,8,9,11', NULL, NULL);
INSERT INTO `Produkter` (`ID`, `Plunr`, `Varenavn`, `Varegruppe`, =
`Varetext`, `Firmanr`, `Firmavarenr`, `Ink=F8bspris`, `Engrospris`, =
`Salgspris`, `Tilbudspris`, `Ern=E6ringID`, `temp`) VALUES (877, '9120', =
'Svinehovede med k=E6besnitte', '07.300', '', '1', '0', '2', '2', =
'1,2,3,4,5,6,7,8,9,10', '1,2,3,4,5,6,7,8,9,11', NULL, NULL);
INSERT INTO `Produkter` (`ID`, `Plunr`, `Varenavn`, `Varegruppe`, =
`Varetext`, `Firmanr`, `Firmavarenr`, `Ink=F8bspris`, `Engrospris`, =
`Salgspris`, `Tilbudspris`, `Ern=E6ringID`, `temp`) VALUES (876, '9129', =
'Skinker ( Hele)', '07.300', '', '1', '0', '2', '2', =
'1,2,3,4,5,6,7,8,9,10', '1,2,3,4,5,6,7,8,9,11', NULL, NULL);
INSERT INTO `Produkter` (`ID`, `Plunr`, `Varenavn`, `Varegruppe`, =
`Varetext`, `Firmanr`, `Firmavarenr`, `Ink=F8bspris`, `Engrospris`, =
`Salgspris`, `Tilbudspris`, `Ern=E6ringID`, `temp`) VALUES (875, '9132', =
'Sv=E6r uden fedt ( affald)', '07.300', '', '1', '0', '2', '2', =
'1,2,3,4,5,6,7,8,9,10', '1,2,3,4,5,6,7,8,9,11', NULL, NULL);

------=_NextPart_000_000D_01C35CF0.20AC1200--

Jul 19 '05 #2
This is a known bug, there is a patch available at:
http://support.microsoft.com/default...b;en-us;319243

Or if you are using Visual Studio .NET 2003 use: System.Data.Odbc instead.

Brandon

"Kenneth Foli Jørgensen" <ke*****@lflug.dk> wrote in message
news:bh**********@FreeBSD.csie.NCTU.edu.tw...
------=_NextPart_000_000D_01C35CF0.20AC1200
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

i get this msg:
Microsoft.Data.Odbc.OdbcException: NO_DATA - no error information =
available
at Microsoft.Data.Odbc.OdbcConnection.HandleError(Int Ptr hHandle, =
SQL_HANDLE hType, RETCODE retcode)
at Microsoft.Data.Odbc.OdbcDataReader.GetData(Int32 i, SQL_C sqlctype, =
Int32 cb)
at Microsoft.Data.Odbc.OdbcDataReader.internalGetStri ng(Int32 i)
at Microsoft.Data.Odbc.OdbcDataReader.GetValue(Int32 i, TypeMap typemap)
at Microsoft.Data.Odbc.OdbcDataReader.GetValue(Int32 i)
at Microsoft.Data.Odbc.DbCache.AccessIndex(Int32 i)
at Microsoft.Data.Odbc.OdbcDataReader.GetValue(Int32 i)
at Microsoft.Data.Odbc.OdbcDataReader.get_Item(String value)
at =
F=E6llesDialogbox.frmAddIngDialog.cboVaregruppe_Se lectedIndexChanged(Obje=
ct sender, EventArgs e) in C:\Documents and Settings\Administrator\My =
Documents\Visual Studio =
Projects\Datasystem\KS\F=E6llesDialogbox\frmAddIng Dialog.vb:line 357

then i try to get a row out fo the database mysql 3.23.54 run on redhat =
linux 9.0 i am acceessing it from vs.net via odbc.net.
i am using myodbc 3.51 and my code look like this:

Try
Dim plunr As Integer
Dim varenavn As String
Dim varegruppenr
Dim Ink=F8bspris
Dim Salgspris As String
Dim Engrospris As String
'Connector/ODBC 3.51 connection string
Dim MyConString As String =3D "DRIVER=3D{MySQL ODBC 3.51 =
Driver};" & _
"SERVER=3D" & =
System.Configuration.ConfigurationSettings.AppSett ings("Host") & _
";DATABASE=3D" & =
System.Configuration.ConfigurationSettings.AppSett ings("Database") & _
";UID=3D" & =
System.Configuration.ConfigurationSettings.AppSett ings("Username") & _
";Password=3D" & =
System.Configuration.ConfigurationSettings.AppSett ings("Password") & _
";"

'Connection
Dim MyConnection As New Odbc.OdbcConnection(MyConString)
MyConnection.Open()
Console.WriteLine("Connection State::" & =
MyConnection.State.ToString)
=20
Dim MyCommand As New Odbc.OdbcCommand()
MyCommand.CommandText =3D "SELECT * FROM Produkter where =
Varegruppe =3D '" & =
Replace(objVaregrupper(cboVaregruppe.SelectedIndex ).Groupnr, ",", ".") & =
"' order by Varenavn"
MyCommand.Connection =3D MyConnection
Dim MyDataReader As Odbc.OdbcDataReader
MyDataReader =3D MyCommand.ExecuteReader
While MyDataReader.Read
objProdukter(t) =3D New clsProdukter()
text +=3D " || "
objProdukter(t) =3D New clsProdukter()
plunr =3D MyDataReader("plunr")
varenavn =3D MyDataReader("Varenavn") =20
Ink=F8bspris =3D MyDataReader("Ink=F8bspris") 'it is =
here all the problems strarts even then i out comment this line =20
Salgspris =3D MyDataReader("Salgspris")
Engrospris =3D MyDataReader("Engrospris")
objProdukter(t) =3D New clsProdukter(CInt(plunr), =
varenavn, varegruppenr, CDbl(Ink=F8bspris), Salgspris, CDbl(Engrospris))
varegruppenr =3D =
objVaregrupper(cboVaregruppe.SelectedIndex)
text +=3D " ID =3D " & MyDataReader("Firmanr")
t +=3D 1
ReDim Preserve objProdukter(t)
End While
MyConnection.Close()
=20
Console.WriteLine("Connection State::" & =
MyConnection.State.ToString)

'Catch ODBC Exception
Catch MyOdbcException As Odbc.OdbcException
MsgBox(MyOdbcException.ToString)
Console.WriteLine(MyOdbcException.ToString)

'Catch program exception
Catch MyException As Exception
MsgBox(MyException.ToString)
End Try
cboProdukter.Items.Clear()
For t =3D 0 To UBound(objProdukter) - 1 Step 1
cboProdukter.Items.Add(objProdukter(t).Navn)
Next

and tis is my db

CREATE TABLE `Produkter` (
`ID` int(11) NOT NULL default '0',
`Plunr` double default NULL,
`Varenavn` varchar(255) default NULL,
`Varegruppe` decimal(10,3) default NULL,
`Varetext` varchar(255) default NULL,
`Firmanr` double default NULL,
`Firmavarenr` double default NULL,
`Ink=F8bspris` double NOT NULL default '0',
`Engrospris` double default NULL,
`Salgspris` varchar(255) default NULL,
`Tilbudspris` varchar(255) default NULL,
`Ern=E6ringID` varchar(255) default NULL,
`temp` varchar(255) default NULL
) TYPE=3DMyISAM;

#
# Data dump for tabellen `Produkter`
#

INSERT INTO `Produkter` (`ID`, `Plunr`, `Varenavn`, `Varegruppe`, =
`Varetext`, `Firmanr`, `Firmavarenr`, `Ink=F8bspris`, `Engrospris`, =
`Salgspris`, `Tilbudspris`, `Ern=E6ringID`, `temp`) VALUES (884, '9069', =
'Stegefl=E6sk, uden ben med sv=E6r', '07.300', '', '1', '0', '2', '2', =
'1,2,3,4,5,6,7,8,9,10', '1,2,3,4,5,6,7,8,9,11', '0929', '0');
INSERT INTO `Produkter` (`ID`, `Plunr`, `Varenavn`, `Varegruppe`, =
`Varetext`, `Firmanr`, `Firmavarenr`, `Ink=F8bspris`, `Engrospris`, =
`Salgspris`, `Tilbudspris`, `Ern=E6ringID`, `temp`) VALUES (883, '9026', =
'Fl=E6skeribs uden ben', '07.300', '', '1', '0', '2', '2', =
'1,2,3,4,5,6,7,8,9,10', '1,2,3,4,5,6,7,8,9,11', '0929', '0');
INSERT INTO `Produkter` (`ID`, `Plunr`, `Varenavn`, `Varegruppe`, =
`Varetext`, `Firmanr`, `Firmavarenr`, `Ink=F8bspris`, `Engrospris`, =
`Salgspris`, `Tilbudspris`, `Ern=E6ringID`, `temp`) VALUES (882, '9007', =
'Krydder Ribben', '07.300', '', '1', '0', '2', '2', =
'1,2,3,4,5,6,7,8,9,10', '1,2,3,4,5,6,7,8,9,11', '0374', '5');
INSERT INTO `Produkter` (`ID`, `Plunr`, `Varenavn`, `Varegruppe`, =
`Varetext`, `Firmanr`, `Firmavarenr`, `Ink=F8bspris`, `Engrospris`, =
`Salgspris`, `Tilbudspris`, `Ern=E6ringID`, `temp`) VALUES (881, '9067', =
'Ba Ribben', '07.300', '', '1', '0', '2', '2', '1,2,3,4,5,6,7,8,9,10', =
'1,2,3,4,5,6,7,8,9,11', '0374', '5');
INSERT INTO `Produkter` (`ID`, `Plunr`, `Varenavn`, `Varegruppe`, =
`Varetext`, `Firmanr`, `Firmavarenr`, `Ink=F8bspris`, `Engrospris`, =
`Salgspris`, `Tilbudspris`, `Ern=E6ringID`, `temp`) VALUES (880, '9111', =
'Forende', '07.300', '', '1', '0', '2', '2', '1,2,3,4,5,6,7,8,9,10', =
'1,2,3,4,5,6,7,8,9,11', NULL, NULL);
INSERT INTO `Produkter` (`ID`, `Plunr`, `Varenavn`, `Varegruppe`, =
`Varetext`, `Firmanr`, `Firmavarenr`, `Ink=F8bspris`, `Engrospris`, =
`Salgspris`, `Tilbudspris`, `Ern=E6ringID`, `temp`) VALUES (879, '9110', =
'Fedtnet', '07.300', '', '1', '0', '2', '2', '1,2,3,4,5,6,7,8,9,10', =
'1,2,3,4,5,6,7,8,9,11', NULL, NULL);
INSERT INTO `Produkter` (`ID`, `Plunr`, `Varenavn`, `Varegruppe`, =
`Varetext`, `Firmanr`, `Firmavarenr`, `Ink=F8bspris`, `Engrospris`, =
`Salgspris`, `Tilbudspris`, `Ern=E6ringID`, `temp`) VALUES (878, '9073', =
'Svinet=E6r', '07.300', '', '1', '0', '2', '2', '1,2,3,4,5,6,7,8,9,10', =
'1,2,3,4,5,6,7,8,9,11', NULL, NULL);
INSERT INTO `Produkter` (`ID`, `Plunr`, `Varenavn`, `Varegruppe`, =
`Varetext`, `Firmanr`, `Firmavarenr`, `Ink=F8bspris`, `Engrospris`, =
`Salgspris`, `Tilbudspris`, `Ern=E6ringID`, `temp`) VALUES (877, '9120', =
'Svinehovede med k=E6besnitte', '07.300', '', '1', '0', '2', '2', =
'1,2,3,4,5,6,7,8,9,10', '1,2,3,4,5,6,7,8,9,11', NULL, NULL);
INSERT INTO `Produkter` (`ID`, `Plunr`, `Varenavn`, `Varegruppe`, =
`Varetext`, `Firmanr`, `Firmavarenr`, `Ink=F8bspris`, `Engrospris`, =
`Salgspris`, `Tilbudspris`, `Ern=E6ringID`, `temp`) VALUES (876, '9129', =
'Skinker ( Hele)', '07.300', '', '1', '0', '2', '2', =
'1,2,3,4,5,6,7,8,9,10', '1,2,3,4,5,6,7,8,9,11', NULL, NULL);
INSERT INTO `Produkter` (`ID`, `Plunr`, `Varenavn`, `Varegruppe`, =
`Varetext`, `Firmanr`, `Firmavarenr`, `Ink=F8bspris`, `Engrospris`, =
`Salgspris`, `Tilbudspris`, `Ern=E6ringID`, `temp`) VALUES (875, '9132', =
'Sv=E6r uden fedt ( affald)', '07.300', '', '1', '0', '2', '2', =
'1,2,3,4,5,6,7,8,9,10', '1,2,3,4,5,6,7,8,9,11', NULL, NULL);

------=_NextPart_000_000D_01C35CF0.20AC1200--

Jul 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Kenneth Foli Jørgensen | last post: by
reply views Thread by Tim Hastings | last post: by
reply views Thread by Dominikus Zimmerer | last post: by
reply views Thread by Bill Davidson | last post: by
reply views Thread by I & L Fogg | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.