So far, I worked with mysql, and nothing else....
So there are differences in sql ansi...
thanks
> As the error indicates, something is wrong in the SQL statement (i.e. the
> value of AccessQuery string variable). So, you need to check that, instead
[quoted text clipped - 37 lines]
>>
>> thanks

Signature
You're not paid to think. A mindless worker is a happy worker. Shut up
and do your job!
- Tata Feudalac!
Certified Social Engineering Specialist (Because there is no patch for
human stupidity)
--------------------------------------------------------
http://www.fotozine.org/index.php?stranica=clan&uid=1352
http://www.thinkgeek.com/brain/gimme.cgi?wid=81d35dc8f
http://groups.google.com/group/fejkneraddangub
http://capetans.bloger.hr
--------------------------------------------------------
I was young, I need gold pieces...
Use a pubs.mdb database (or northwind.mdb) and try simple selects like
"Select * from authors" or "Select * from Orders"
DO "Select * " ONLY AS A TEST... DON"T LeAVE IT THAT WAY.
Get the simple thing working first, then move on to more advanced queries.
..
Now, to your code.
I know you can't .Close, and I think you can't .Dispose of an IDataReader
before using it.
Change your code to:
> >> Public Function GetDataReader(ByVal AccessQuery As String) As
IDataReader
> >> Dim AccessConnection As System.Data.OleDb.OleDbConnection
> >> Dim AccessCommand As System.Data.OleDb.OleDbCommand
> >> Dim AccessReader As System.Data.OleDb.OleDbDataReader
> >> Try
> >> AccessConnection.Open()
[quoted text clipped - 5 lines]
> >> GetDataReader = AccessReader
> >> Finally
> >> End Try
>> End Function
AFTER YOU RETURN It and after you use it. do this.
sub ProcWhichCallsTheAboveProc
dim idr as IDataReader
''idr as IDataReader
try
idr = new DAL().GetDataReader("Select * from authors")
'' use the IDataReader
finally
if not ( idr is nothing) then
idr.Close()
end if
end try
> So far, I worked with mysql, and nothing else....
> So there are differences in sql ansi...
[quoted text clipped - 42 lines]
> >>
> >> thanks
feudalac! - 06 Oct 2006 08:05 GMT
> Use a pubs.mdb database (or northwind.mdb) and try simple selects like
>
[quoted text clipped - 4 lines]
> Get the simple thing working first, then move on to more advanced queries.
> ..
I know SQL well... i never used access before...
in MySQL it is : WHERE field_name='value'
in Access it is : WHERE (((field_name)=value))
i didn't know there were theese differences in sql ansi....
> Now, to your code.
>
> I know you can't .Close, and I think you can't .Dispose of an IDataReader
> before using it.
The code works fine as it is (it is copy+paste from my MySQL program)
as Norman said... there was a problem with my query...
Thanks for help everyone
> Change your code to:
>
[quoted text clipped - 36 lines]
>
> end try

Signature
You're not paid to think. A mindless worker is a happy worker. Shut up
and do your job!
- Tata Feudalac!
Certified Social Engineering Specialist (Because there is no patch for
human stupidity)
--------------------------------------------------------
http://www.fotozine.org/index.php?stranica=clan&uid=1352
http://www.thinkgeek.com/brain/gimme.cgi?wid=81d35dc8f
http://groups.google.com/group/fejkneraddangub
http://capetans.bloger.hr
--------------------------------------------------------
I was young, I need gold pieces...