Print Page | Close Window

MySQL newbie syntax question

Printed From: Web Wiz Forums
Category: Web Wiz Web App Support Forums
Forum Name: Web Wiz Forums
Forum Description: Support forum for Web Wiz Forums application.
URL: https://forums.webwiz.net/forum_posts.asp?TID=25321
Printed Date: 03 April 2026 at 10:59pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: MySQL newbie syntax question
Posted By: freakdaddy
Subject: MySQL newbie syntax question
Date Posted: 19 February 2008 at 10:08pm
Hello - I'm trying to learn some of the syntaxing for mysql. I know access real well, and I'm just trying to learn the minor differences. I'm trying to have WWF check for a value in the database (an expiration date), and I created an ASP page to open up the database, but I'm getting the following error:
Microsoft VBScript runtime error '800a01a8'

Object required: ''

It's pointing to the line where I open the database:

    'Query the database
    rsCommon.Open strSQL, adoCon

So obviously something isn't set right. I used the dbconnection(everything is set fine inthsi file as the board runs) include file on this page, and have the following code:

GID = "5" ' just set for sample purposes

        strSQL = "SELECT " & strDbTable & "Author.* " & _
    "FROM " & strDbTable & "Author" & strDBNoLock & " " & _
    "WHERE " & strDbTable & "Author.Author_ID = " & GID & ";"

       
    'Query the database
    rsCommon.Open strSQL, adoCon   
       
    If NOT rsCommon.EOF Then
       
        'Grab users group ID
        ID = rsCommon("Group_ID")


Is this an incorrect way to just get all the fields from this specific Author_ID? Is there something else I need to set with the connection first ( I have to add the closing part of the code of course)? Help is really appreciated. Thanks.



Replies:
Posted By: Ralpharama
Date Posted: 20 February 2008 at 4:38pm
Try:

strSQL = "SELECT * FROM "&strDbTable&"Author"&strDBNoLock&" " & _

...


Posted By: StarDust
Date Posted: 21 February 2008 at 8:19am
your SQL string seems correct.

Though it is very rare, sometimes a corrupted database cause this problem.


-------------
http://board.ebizbd.net/">Tips, mods and skins for WWF v9.x


Posted By: WebWiz-Bruce
Date Posted: 21 February 2008 at 9:05am
The part strDBNoLock is only used for SQL Server databases.

-------------
https://www.webwiz.net/web-wiz-forums/forum-hosting.htm" rel="nofollow - Web Wiz Forums Hosting
https://www.webwiz.net/web-hosting/windows-web-hosting.htm" rel="nofollow - ASP.NET Web Hosting


Posted By: StarDust
Date Posted: 21 February 2008 at 9:37am
Originally posted by WebWiz-Bruce WebWiz-Bruce wrote:

The part strDBNoLock is only used for SQL Server databases.


Bruce isn't wwf use different values for strDBNoLock and strDBRowLock according to strDatabaseType variable value?


-------------
http://board.ebizbd.net/">Tips, mods and skins for WWF v9.x


Posted By: freakdaddy
Date Posted: 24 February 2008 at 6:13am
Originally posted by WebWiz-Bruce WebWiz-Bruce wrote:

The part strDBNoLock is only used for SQL Server databases.


Yeah, I was just following the syntax that you guys had in their. It seems to be used all of the time, and it's value was set in another file. So should I take this out when using MySQL?


Posted By: StarDust
Date Posted: 24 February 2008 at 11:00am
Originally posted by WebWiz-Bruce WebWiz-Bruce wrote:

The part strDBNoLock is only used for SQL Server databases.


Freadkdaddy, as Bruce said, it is only used for SQL Server databases.

However there is another variable which controls the value of "strDBNoLock". This variable "strDatabaseType". When you set strDatabaseType = "mySQL" in database/database_connection.asp off WWF installation, strDBNoLock becomes an empty variable with no value. So, it is all the same using the variable or not. But make sure you have a trailing space in your SQL syntax after these variables.


-------------
http://board.ebizbd.net/">Tips, mods and skins for WWF v9.x


Posted By: freakdaddy
Date Posted: 25 February 2008 at 7:02am
Thanks... so technically, this should work?

     strSQL = "SELECT " & strDbTable & "Author.* " & _
"FROM " & strDbTable & "Author" & strDBNoLock & " " & _
    "WHERE " & strDbTable & "Author.Author_ID = " & GID & " " &";"

Do I need the end semi-colon or not? I dunno, but I just need some kind of syntax for mysql so that I can open the database and select data from the author_ID table. So lost at this point. Wasn't expecting it to be this difficult to find the correct format. Unhappy


Posted By: freakdaddy
Date Posted: 27 February 2008 at 7:49am
help... still stuck Unhappy


Posted By: StarDust
Date Posted: 27 February 2008 at 9:13am
freakdaddy,

If the problem still persists, then there might be some other things wrong. Here is a checklist for you:

1. Make sure the changes you have made in the code of wwf is correct.
2. In some rare occasions, when database is corrupt, i have seen the same error. Try with a fresh database.
3. Make sure GID has a numeric value when executing the SQL statement. Change it from GID = "5" to GID = 5
4. In your code, the value of strDBNoLock might be wrong. Try following SQL statement:

strSQL = "SELECT " & strDbTable & "Author.* " & _
"FROM " & strDbTable & "Author " & _
    "WHERE " & strDbTable & "Author.Author_ID=" & GID & " ;"

This way my problems were gone.



-------------
http://board.ebizbd.net/">Tips, mods and skins for WWF v9.x


Posted By: freakdaddy
Date Posted: 28 February 2008 at 1:25am
Thanks..

Yeah, I had done all of the above already. There's something else that's not right, but I don't know enough about mysql to figure it out. It's kind of beyond frustrating because it shouldn't be that difficult. I just want to open the WWF mysql database and from the author_id, or actually the user_code table.

My whole syntax may be incorrect, so just some direction about how you'd set this up to open the database would be very very helpful.




Posted By: StarDust
Date Posted: 28 February 2008 at 6:38am
Is everything else is running? The forum? If it is, the solution is unknown to me. Sorry.


-------------
http://board.ebizbd.net/">Tips, mods and skins for WWF v9.x


Posted By: freakdaddy
Date Posted: 28 February 2008 at 7:15am
Everything is running 100% fine. I just need to know how to open the database. I've tried everything that I think would be beyond obvious, and I just can't get it to work. 


Posted By: freakdaddy
Date Posted: 29 February 2008 at 12:46am
Ok, I bet if I say I'll pay someone money I'll get a response.

I need someone to work out this issue, and also pull data from WWF's cookies properly. If someone is interested in doing this, PM me.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net