Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Help Groups for Snitz Forums 2000 Users
 Help: Database: MS SQL Server
 Getting data from database
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

johny1900
Starting Member

11 Posts

Posted - 13 April 2009 :  03:56:39  Show Profile
Hi,

I have been trying to get some data of the database which came with the Forum.
But when I do something like:

Sql="Select * from FORUM_MEMBERS"

And it gives me an error of
"Microsoft OLE DB Provider for ODBC Drivers error '80040e37'

[Microsoft][ODBC SQL Server Driver][SQL Server]The name of the object 'FORUM_MEMBERS' not valid.
"
Which I find strange as it works when I add a new table (same select) at the same DB.
It is like it has been protected or so.... I never saw this before. ANybody any idea?


So is there something special for these tables which came with the Forum?


Edited by - johny1900 on 13 April 2009 05:05:20

gpctexas
Junior Member

320 Posts

Posted - 13 April 2009 :  05:22:27  Show Profile  Visit gpctexas's Homepage
You need to add the table prefix also

Sql="Select * from " & strTablePrefix & "FORUM_MEMBERS"

maybe?



edit: late night no sleep misread

ipgate 2.4.4 RC3
http://www.gpctexas.net/ipgate_v244.zip

Edited by - gpctexas on 13 April 2009 05:30:41
Go to Top of Page

johny1900
Starting Member

11 Posts

Posted - 13 April 2009 :  05:34:53  Show Profile
Thx gpctexas!!
It was indeed what I needed. I checked the code of it as took it so that in my personal ASp file it will respect the SQL code. As i connect differently to the DB.

Thx also for te FAST reply.....!!!
Go to Top of Page

AnonJr
Moderator

United States
5768 Posts

Posted - 13 April 2009 :  06:32:45  Show Profile  Visit AnonJr's Homepage
Just keep in mind that with the "FORUM_MEMBERS" table it would be strMemberTablePrefix, and with certain tables - like the badwords table - it would be strFilterTablePrefix. 99.9% of the time they are all the same as that is the default configuration. But its a good idea to use the proper one as you never know what you'll end up doing in the future.
Go to Top of Page

johny1900
Starting Member

11 Posts

Posted - 13 April 2009 :  06:33:38  Show Profile
Hi again,

mayeb you know why it isnīt possible to get the data of the column "M_POSTS"?
I can get any column, except tha one.... there is NO error. It just return it to me empty (Althought there is data in it)
Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 13 April 2009 :  06:58:43  Show Profile  Send ruirib a Yahoo! Message
What SQL statement are you using? How are you processing the recordset?


Snitz 3.4 Readme | Like the support? Support Snitz too
Go to Top of Page

johny1900
Starting Member

11 Posts

Posted - 13 April 2009 :  07:40:27  Show Profile
quote:
Originally posted by ruirib

What SQL statement are you using? How are you processing the recordset?



I just use the normal stuff
	
	
StrSql="Select * from "&strTablePrefix&"MEMBERS where m_name='"&TRIM(rs("nombre"))&"'"
set rsConfig = my_Conn.Execute (strSql)
IF rsConfig.EOF THEN
[some code here]
else
response.write(rsconfig("M_POSTS")) [<--- does not display anything]
response.write(rsconfig("M_M_LASTPOSTDATE")) [<--- displays last date of a post]
End if


What is strange that I just canīt display anything from that column, any other column is OK. The column is INT type, but that shouldnīt be a problem, should it?

All the conection are done as gpctexas sai and work fine
Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 13 April 2009 :  09:47:07  Show Profile  Send ruirib a Yahoo! Message
You sure the column has data?


Snitz 3.4 Readme | Like the support? Support Snitz too
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.15 seconds. Powered By: Snitz Forums 2000 Version 3.4.07