does anybody knows how should i correct this error?

does anybody knows how should i correct this error?

am 05.01.2007 22:53:26 von groupy

This is the error:

Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[MySQL][ODBC 3.51 Driver][mysqld-4.1.13a-nt]No database selected

given after trying to browse to my login.asp. my DB is mysql & i have a
successful ODBC connection with it (i tested it). Should i choose a
database? where?
Above is the referenced code from which the error accurs (last line
causes the error):

Function OpenRS(SQLText)
Call OpenDBCon()
dim temp
set temp = Server.CreateObject("ADODB.RecordSet")
set temp.ActiveConnection = Conn
temp.CursorLocation = 3 'adUseClient
temp.CursorType = 0 'adOpenForwardOnly
temp.LockType = 1 ' adLockReadOnly
temp.source = SQLText
temp.open

Thanks.

Re: does anybody knows how should i correct this error?

am 06.01.2007 13:19:42 von reb01501

liav.ezer@gmail.com wrote:
> This is the error:
>
> Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
> [MySQL][ODBC 3.51 Driver][mysqld-4.1.13a-nt]No database selected
>
> given after trying to browse to my login.asp. my DB is mysql & i have
> a successful ODBC connection with it (i tested it). Should i choose a
> database? where?
> Above is the referenced code from which the error accurs (last line
> causes the error):
>
> Function OpenRS(SQLText)
> Call OpenDBCon()
> dim temp
> set temp = Server.CreateObject("ADODB.RecordSet")
> set temp.ActiveConnection = Conn
> temp.CursorLocation = 3 'adUseClient
> temp.CursorType = 0 'adOpenForwardOnly
> temp.LockType = 1 ' adLockReadOnly
> temp.source = SQLText
> temp.open
>
> Thanks.

Show the code where you instantiate and open the Conn object. Also, add the
following line to this function, run the page and show us the result:

Function OpenRS(SQLText)
Call OpenDBCon()
dim temp
set temp = Server.CreateObject("ADODB.RecordSet")

'********************************************************
response.write typename(Conn) & "
"
'*********************************************************
set temp.ActiveConnection = Conn
temp.CursorLocation = 3 'adUseClient
temp.CursorType = 0 'adOpenForwardOnly

These are contradictory settings. The only type of cursor you will get if
you specify adUseClient is a static cursor (adOpenStatic). If you really
want a forward-only cursor, then simple use the defalt cursor:

Set temp = Conn.Execute(SQLText,,1) 'adCmdText



--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"