473,786 Members | 2,420 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

myodbc error

------=_NextPart_000_ 000D_01C35CF0.2 0AC1200
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

i get this msg:
Microsoft.Data. Odbc.OdbcExcept ion: NO_DATA - no error information =
available
at Microsoft.Data. Odbc.OdbcConnec tion.HandleErro r(IntPtr hHandle, =
SQL_HANDLE hType, RETCODE retcode)
at Microsoft.Data. Odbc.OdbcDataRe ader.GetData(In t32 i, SQL_C sqlctype, =
Int32 cb)
at Microsoft.Data. Odbc.OdbcDataRe ader.internalGe tString(Int32 i)
at Microsoft.Data. Odbc.OdbcDataRe ader.GetValue(I nt32 i, TypeMap typemap)
at Microsoft.Data. Odbc.OdbcDataRe ader.GetValue(I nt32 i)
at Microsoft.Data. Odbc.DbCache.Ac cessIndex(Int32 i)
at Microsoft.Data. Odbc.OdbcDataRe ader.GetValue(I nt32 i)
at Microsoft.Data. Odbc.OdbcDataRe ader.get_Item(S tring value)
at =
F=E6llesDialogb ox.frmAddIngDia log.cboVaregrup pe_SelectedInde xChanged(Obje=
ct sender, EventArgs e) in C:\Documents and Settings\Admini strator\My =
Documents\Visua l Studio =
Projects\Datasy stem\KS\F=E6lle sDialogbox\frmA ddIngDialog.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{MySQ L ODBC 3.51 =
Driver};" & _
"SERVER=3D" & =
System.Configur ation.Configura tionSettings.Ap pSettings("Host ") & _
";DATABASE= 3D" & =
System.Configur ation.Configura tionSettings.Ap pSettings("Data base") & _
";UID=3D" & =
System.Configur ation.Configura tionSettings.Ap pSettings("User name") & _
";Password= 3D" & =
System.Configur ation.Configura tionSettings.Ap pSettings("Pass word") & _
";"

'Connection
Dim MyConnection As New Odbc.OdbcConnec tion(MyConStrin g)
MyConnection.Op en()
Console.WriteLi ne("Connection State::" & =
MyConnection.St ate.ToString)
=20
Dim MyCommand As New Odbc.OdbcComman d()
MyCommand.Comma ndText =3D "SELECT * FROM Produkter where =
Varegruppe =3D '" & =
Replace(objVare grupper(cboVare gruppe.Selected Index).Groupnr, ",", ".") & =
"' order by Varenavn"
MyCommand.Conne ction =3D MyConnection
Dim MyDataReader As Odbc.OdbcDataRe ader
MyDataReader =3D MyCommand.Execu teReader
While MyDataReader.Re ad
objProdukter(t) =3D New clsProdukter()
text +=3D " || "
objProdukter(t) =3D New clsProdukter()
plunr =3D MyDataReader("p lunr")
varenavn =3D MyDataReader("V arenavn") =20
Ink=F8bspris =3D MyDataReader("I nk=F8bspris") 'it is =
here all the problems strarts even then i out comment this line =20
Salgspris =3D MyDataReader("S algspris")
Engrospris =3D MyDataReader("E ngrospris")
objProdukter(t) =3D New clsProdukter(CI nt(plunr), =
varenavn, varegruppenr, CDbl(Ink=F8bspr is), Salgspris, CDbl(Engrospris ))
varegruppenr =3D =
objVaregrupper( cboVaregruppe.S electedIndex)
text +=3D " ID =3D " & MyDataReader("F irmanr")
t +=3D 1
ReDim Preserve objProdukter(t)
End While
MyConnection.Cl ose()
=20
Console.WriteLi ne("Connection State::" & =
MyConnection.St ate.ToString)

'Catch ODBC Exception
Catch MyOdbcException As Odbc.OdbcExcept ion
MsgBox(MyOdbcEx ception.ToStrin g)
Console.WriteLi ne(MyOdbcExcept ion.ToString)

'Catch program exception
Catch MyException As Exception
MsgBox(MyExcept ion.ToString)
End Try
cboProdukter.It ems.Clear()
For t =3D 0 To UBound(objProdu kter) - 1 Step 1
cboProdukter.It ems.Add(objProd ukter(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.2 0AC1200--

Jul 19 '05 #1
2 2521
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.Odb c instead.

Brandon

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

i get this msg:
Microsoft.Data. Odbc.OdbcExcept ion: NO_DATA - no error information =
available
at Microsoft.Data. Odbc.OdbcConnec tion.HandleErro r(IntPtr hHandle, =
SQL_HANDLE hType, RETCODE retcode)
at Microsoft.Data. Odbc.OdbcDataRe ader.GetData(In t32 i, SQL_C sqlctype, =
Int32 cb)
at Microsoft.Data. Odbc.OdbcDataRe ader.internalGe tString(Int32 i)
at Microsoft.Data. Odbc.OdbcDataRe ader.GetValue(I nt32 i, TypeMap typemap)
at Microsoft.Data. Odbc.OdbcDataRe ader.GetValue(I nt32 i)
at Microsoft.Data. Odbc.DbCache.Ac cessIndex(Int32 i)
at Microsoft.Data. Odbc.OdbcDataRe ader.GetValue(I nt32 i)
at Microsoft.Data. Odbc.OdbcDataRe ader.get_Item(S tring value)
at =
F=E6llesDialogb ox.frmAddIngDia log.cboVaregrup pe_SelectedInde xChanged(Obje=
ct sender, EventArgs e) in C:\Documents and Settings\Admini strator\My =
Documents\Visua l Studio =
Projects\Datasy stem\KS\F=E6lle sDialogbox\frmA ddIngDialog.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{MySQ L ODBC 3.51 =
Driver};" & _
"SERVER=3D" & =
System.Configur ation.Configura tionSettings.Ap pSettings("Host ") & _
";DATABASE= 3D" & =
System.Configur ation.Configura tionSettings.Ap pSettings("Data base") & _
";UID=3D" & =
System.Configur ation.Configura tionSettings.Ap pSettings("User name") & _
";Password= 3D" & =
System.Configur ation.Configura tionSettings.Ap pSettings("Pass word") & _
";"

'Connection
Dim MyConnection As New Odbc.OdbcConnec tion(MyConStrin g)
MyConnection.Op en()
Console.WriteLi ne("Connection State::" & =
MyConnection.St ate.ToString)
=20
Dim MyCommand As New Odbc.OdbcComman d()
MyCommand.Comma ndText =3D "SELECT * FROM Produkter where =
Varegruppe =3D '" & =
Replace(objVare grupper(cboVare gruppe.Selected Index).Groupnr, ",", ".") & =
"' order by Varenavn"
MyCommand.Conne ction =3D MyConnection
Dim MyDataReader As Odbc.OdbcDataRe ader
MyDataReader =3D MyCommand.Execu teReader
While MyDataReader.Re ad
objProdukter(t) =3D New clsProdukter()
text +=3D " || "
objProdukter(t) =3D New clsProdukter()
plunr =3D MyDataReader("p lunr")
varenavn =3D MyDataReader("V arenavn") =20
Ink=F8bspris =3D MyDataReader("I nk=F8bspris") 'it is =
here all the problems strarts even then i out comment this line =20
Salgspris =3D MyDataReader("S algspris")
Engrospris =3D MyDataReader("E ngrospris")
objProdukter(t) =3D New clsProdukter(CI nt(plunr), =
varenavn, varegruppenr, CDbl(Ink=F8bspr is), Salgspris, CDbl(Engrospris ))
varegruppenr =3D =
objVaregrupper( cboVaregruppe.S electedIndex)
text +=3D " ID =3D " & MyDataReader("F irmanr")
t +=3D 1
ReDim Preserve objProdukter(t)
End While
MyConnection.Cl ose()
=20
Console.WriteLi ne("Connection State::" & =
MyConnection.St ate.ToString)

'Catch ODBC Exception
Catch MyOdbcException As Odbc.OdbcExcept ion
MsgBox(MyOdbcEx ception.ToStrin g)
Console.WriteLi ne(MyOdbcExcept ion.ToString)

'Catch program exception
Catch MyException As Exception
MsgBox(MyExcept ion.ToString)
End Try
cboProdukter.It ems.Clear()
For t =3D 0 To UBound(objProdu kter) - 1 Step 1
cboProdukter.It ems.Add(objProd ukter(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.2 0AC1200--

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.Odb c instead.

Brandon

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

i get this msg:
Microsoft.Data. Odbc.OdbcExcept ion: NO_DATA - no error information =
available
at Microsoft.Data. Odbc.OdbcConnec tion.HandleErro r(IntPtr hHandle, =
SQL_HANDLE hType, RETCODE retcode)
at Microsoft.Data. Odbc.OdbcDataRe ader.GetData(In t32 i, SQL_C sqlctype, =
Int32 cb)
at Microsoft.Data. Odbc.OdbcDataRe ader.internalGe tString(Int32 i)
at Microsoft.Data. Odbc.OdbcDataRe ader.GetValue(I nt32 i, TypeMap typemap)
at Microsoft.Data. Odbc.OdbcDataRe ader.GetValue(I nt32 i)
at Microsoft.Data. Odbc.DbCache.Ac cessIndex(Int32 i)
at Microsoft.Data. Odbc.OdbcDataRe ader.GetValue(I nt32 i)
at Microsoft.Data. Odbc.OdbcDataRe ader.get_Item(S tring value)
at =
F=E6llesDialogb ox.frmAddIngDia log.cboVaregrup pe_SelectedInde xChanged(Obje=
ct sender, EventArgs e) in C:\Documents and Settings\Admini strator\My =
Documents\Visua l Studio =
Projects\Datasy stem\KS\F=E6lle sDialogbox\frmA ddIngDialog.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{MySQ L ODBC 3.51 =
Driver};" & _
"SERVER=3D" & =
System.Configur ation.Configura tionSettings.Ap pSettings("Host ") & _
";DATABASE= 3D" & =
System.Configur ation.Configura tionSettings.Ap pSettings("Data base") & _
";UID=3D" & =
System.Configur ation.Configura tionSettings.Ap pSettings("User name") & _
";Password= 3D" & =
System.Configur ation.Configura tionSettings.Ap pSettings("Pass word") & _
";"

'Connection
Dim MyConnection As New Odbc.OdbcConnec tion(MyConStrin g)
MyConnection.Op en()
Console.WriteLi ne("Connection State::" & =
MyConnection.St ate.ToString)
=20
Dim MyCommand As New Odbc.OdbcComman d()
MyCommand.Comma ndText =3D "SELECT * FROM Produkter where =
Varegruppe =3D '" & =
Replace(objVare grupper(cboVare gruppe.Selected Index).Groupnr, ",", ".") & =
"' order by Varenavn"
MyCommand.Conne ction =3D MyConnection
Dim MyDataReader As Odbc.OdbcDataRe ader
MyDataReader =3D MyCommand.Execu teReader
While MyDataReader.Re ad
objProdukter(t) =3D New clsProdukter()
text +=3D " || "
objProdukter(t) =3D New clsProdukter()
plunr =3D MyDataReader("p lunr")
varenavn =3D MyDataReader("V arenavn") =20
Ink=F8bspris =3D MyDataReader("I nk=F8bspris") 'it is =
here all the problems strarts even then i out comment this line =20
Salgspris =3D MyDataReader("S algspris")
Engrospris =3D MyDataReader("E ngrospris")
objProdukter(t) =3D New clsProdukter(CI nt(plunr), =
varenavn, varegruppenr, CDbl(Ink=F8bspr is), Salgspris, CDbl(Engrospris ))
varegruppenr =3D =
objVaregrupper( cboVaregruppe.S electedIndex)
text +=3D " ID =3D " & MyDataReader("F irmanr")
t +=3D 1
ReDim Preserve objProdukter(t)
End While
MyConnection.Cl ose()
=20
Console.WriteLi ne("Connection State::" & =
MyConnection.St ate.ToString)

'Catch ODBC Exception
Catch MyOdbcException As Odbc.OdbcExcept ion
MsgBox(MyOdbcEx ception.ToStrin g)
Console.WriteLi ne(MyOdbcExcept ion.ToString)

'Catch program exception
Catch MyException As Exception
MsgBox(MyExcept ion.ToString)
End Try
cboProdukter.It ems.Clear()
For t =3D 0 To UBound(objProdu kter) - 1 Step 1
cboProdukter.It ems.Add(objProd ukter(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.2 0AC1200--

Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
1918
by: dave | last post by:
hi I want to install mysql odbc driver 3.51 and downloaded MyODBC-3.51.06-dll.zip from the mysql.com. but when i unzipped it, it shows only dll file.. I m very confused how to install odbc driver? would i need to install whole mysql as well or i can just install myodbc driver? I just wanted to create DSN to remote server.. I'm using windows xp Any help would be appreciated..
0
786
by: Kenneth Foli Jørgensen | last post by:
------=_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(IntPtr hHandle, = SQL_HANDLE hType, RETCODE retcode)
0
1515
by: Chris R. | last post by:
I'm trying to do what I thought was a fairly simple thing, select a group of records from a mySQL database. I'm not much of an SQL guy. The syntax I would use for Microsoft SQL is shown on the "query =" line. A myODBC error message indicates this is not supported syntax. Can anyone help me? { ADO Startup Values and Creation using the .Open method} {Create a COM object reference to ADO Recordset.}
0
1377
by: Tim Hastings | last post by:
Hello, I am using MyODBC from VB and I want to submit a batch of insert statements in one call from my App. This is more efficient than making multiple calls from code because of the communication overhead. If I send a batch multiple statements separated by ; or ; + newline I get syntax errors pointing at the start of the next statement.. If I fire each statement one at a time with the ; at the end there's no problem.
0
641
by: Bob | last post by:
Has anyone tried (and succeded?) in specifying the appropriate connect string for a hierarchical dataset using MyODBC? It's where you specify MSDATASHAPE as your "Provider" but then need to designate MyODBC as the "Data" Provider. I've been beating my head against this one far too long to not ask for help. Thanks,
0
542
by: Dominikus Zimmerer | last post by:
Hello, i want to install the MyODBC driver for windows. i donwloaded the newest installer from the mysql website. -> MyODBC-3.51.06.exe now i know the command line parameter for a silent installation (/s), but i wonder if there are more... Logfile.... I didnt find anything in the forum or an mysql website, so maybe
0
1529
by: qhe | last post by:
Dear All: I'm using MyODBC 3.51.06 and MySQL 4.0.18. My table has a mediumblob field, but I can't update/insert data larger than 64K. The test application is created by VC6 appwizard, here is the test code: m_pSet->GetODBCFieldInfo(2, fieldinfo); n = fieldinfo.m_nPrecision;
0
1491
by: Bill Davidson | last post by:
Hello: I have a thin C++ database access library that can be used with MySQL *only* through MyODBC. I would like to use this database access library with embedded mySQL server. Would that be possible ? I guess a more specific question would be: Is it possible to use the embedded mySQL server via MyODBC ? I am using Windows XP.
0
1197
by: I & L Fogg | last post by:
My client (and hence I!) need to install MyODBC on a Citrix server, but when the MyODBC installation .exe is run, it fails. The .msi also fails. Investigation on the web indicates that this might have something to do with the Citrix environment not liking "hardcoded" paths in installation programs, but naive fumbling with Orca on the .msi didn't really help. Has anyone succeeded in installing MyODBC in a Citrix environment, and if so,...
1
4250
by: Matthias HALDIMANN | last post by:
When importing data into MS SQL Server 2000 from a MyODBC (v3.51) data source using Data Transformation Services, special characters like öäüéàè are not imported correctly. However, when the MyODBC data source is used in any other program like Access, Excel etc. it works fine. Does anyone have any experience with this? Any hint to solve this problem would be very much appreciated! Matthias Haldimann
0
9647
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9492
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10163
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10108
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9960
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7510
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6744
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5397
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5532
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.