does anybody knows how should i correct this error?

L

liav.ezer

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.
 
B

Bob Barrows [MVP]

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) & "<BR>"
'*********************************************************
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top