Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 sql request in vb (only columns name return)

Author  Topic 

scrap
Yak Posting Veteran

57 Posts

Posted - 2005-05-19 : 08:57:30
Hi
i have the variables "sqlstring" and "conn" fill then execute
"Rs.Open sqlstring, conn"
"DataReport1.Sections("TitlesDetail").Controls.Item(txtAdr).DataField = Rs.Fields(0).Name"

but the Rs.fields are only the columns name.
I analysed the request through sql analyser and the result should be "1"

Any help is welcome.

scrap
Yak Posting Veteran

57 Posts

Posted - 2005-05-19 : 09:08:17
I want to add something:
The sqlstring is a select * from table where condition.

The author
Go to Top of Page

scrap
Yak Posting Veteran

57 Posts

Posted - 2005-05-19 : 09:14:47
With a big 2 minutes of debugging ijust figured out the problem:

DataReport1.Sections("TitlesDetail").Controls.Item(txtAdr).DataField = Rs.Fields(0).Name

Should be
Value
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-05-19 : 10:27:06
It is always better to use Rs("ColumnName") instead of Rs.Fields(0).value

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -