help me : why don't get record? 
Author Message
 help me : why don't get record?

Public Function getrecord()
Dim rs, adoconn, sql
Set adoconn = CreateObject("adoce.connection.3.0")
adoconn.Open "data source=\my documents\test.cdb"

sql = "select * from test900"
Set rs = CreateObject("adoce.recordset.3.0")
rs.Open sql, adoconn
info.TextFields1.Text = rs("tt_name")
info.TextFields2.Text = rs("tt_age")
info.TextFields3.Text = rs("tt_danwei")
info.TextFields4.Text = rs("tt_sex")
info.TextFields5.Text = rs("tt_edu")
info.TextFields6.Text = rs("tt_school")
info.TextFields7.Text = rs("tt_born")
info.TextFields8.Text = rs("tt_work")
info.TextFields9.Text = rs("tt_work1")
rs.Close
Set rs = Nothing
Set adoconn = Nothing

End Function

It's a errors :  type mismatch.



Tue, 24 Aug 2004 09:09:37 GMT  
 help me : why don't get record?
If any of the fields are null, you'll get that error.  Try appending an
empty string to each field first, like this:

info.TextFields1.Text = rs("tt_name") & ""
info.TextFields2.Text = rs("tt_age") & ""
info.TextFields3.Text = rs("tt_danwei") & ""
info.TextFields4.Text = rs("tt_sex") & ""
info.TextFields5.Text = rs("tt_edu") & ""
info.TextFields6.Text = rs("tt_school") & ""
info.TextFields7.Text = rs("tt_born") & ""
info.TextFields8.Text = rs("tt_work") & ""
info.TextFields9.Text = rs("tt_work1") & ""

-Chris


Quote:

> Public Function getrecord()
> Dim rs, adoconn, sql
> Set adoconn = CreateObject("adoce.connection.3.0")
> adoconn.Open "data source=\my documents\test.cdb"

> sql = "select * from test900"
> Set rs = CreateObject("adoce.recordset.3.0")
> rs.Open sql, adoconn
> info.TextFields1.Text = rs("tt_name")
> info.TextFields2.Text = rs("tt_age")
> info.TextFields3.Text = rs("tt_danwei")
> info.TextFields4.Text = rs("tt_sex")
> info.TextFields5.Text = rs("tt_edu")
> info.TextFields6.Text = rs("tt_school")
> info.TextFields7.Text = rs("tt_born")
> info.TextFields8.Text = rs("tt_work")
> info.TextFields9.Text = rs("tt_work1")
> rs.Close
> Set rs = Nothing
> Set adoconn = Nothing

> End Function

> It's a errors :  type mismatch.



Tue, 24 Aug 2004 23:15:04 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Getting Error 13, help - don't understand why

2. PLS Help, I don't know why to write

3. PLS Help, I don't know why to write

4. Why don't my exe's and ocx's unregister

5. Can anyone help me understand why I'm getting this exception

6. Why don't the changes show in realtime

7. Why don't macro buttons transfer in email

8. Migration to VS 2003 worked though I don't know why

9. Why don't I beep?

10. Why i don't have System.Management ??

11. does anybody know why this code don't work

12. I don't know why..

 

 
Powered by phpBB® Forum Software