li*******@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.CreateOb ject("ADODB.Rec ordSet")
set temp.ActiveConn ection = Conn
temp.CursorLoca tion = 3 'adUseClient
temp.CursorType = 0 'adOpenForwardO nly
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.CreateOb ject("ADODB.Rec ordSet")
'************** *************** *************** ************
response.write typename(Conn) & "<BR>"
'************** *************** *************** *************
set temp.ActiveConn ection = Conn
temp.CursorLoca tion = 3 'adUseClient
temp.CursorType = 0 'adOpenForwardO nly
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(SQ LText,,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"