Loading

Need Help for NSDataCombo

15 posts / 0 new
Last post
Offline
Joined: 11/17/2008
Need Help for NSDataCombo

I Have been Strugling to Write the Code for Multicolumn to Display two feilds in m combo below is my code for the it
keeps on giving the Error

DATASOURCE NAME NOT FOUND AND NO DEFAULT DRIVER SPECIFIED

where as i already supplied this plz have look

Dim cn As New ADODB.Connection
Dim rs As New ADODB.Recordset
Dim strSQL As String

On Error GoTo General_Error

cn.Open SysConnect (This is Connection String where everey thing is supplied)

rs.CursorType = adOpenKeyset
rs.LockType = adLockOptimistic

strSQL = ""
strSQL = "Select * from cus0001s"

rs.Open Trim(strSQL), cn, , , adCmdUnspecified

NSDataCombo1.Columnclear
If Not rs.EOF And Not rs.BOF Then
While Not rs.EOF
If Not IsNull(rs!cid) Then
NSDataCombo1.AddColumn Trim(rs!cid)
NSDataCombo1.AddColumn Trim(rs!cin)
End If

rs.MoveNext
Wend
End If

rs.Close
cn.Close

On Error GoTo 0
Exit Sub
General_Error:
MsgBox "Error: [" & Err.Number & "] " & Err.Description, vbCritical + vbOKOnly, "Stock Control Management SCM (V1.01)"
If rs.State = ADODB.adRecObjectOpen Then
rs.Close
End If
If cn.State = 1 Then
cn.Close
End If
On Error GoTo 0

admin's picture
Online
Joined: 11/14/2008
re: Need Help for NSDataCombo

Try this code instead:

  1. Private Sub InitNSD()
  2. With NSDataCombo1
  3. .ClearColumn
  4. .AddColumn "CID", 1794.89
  5. .AddColumn "CIN", 2264.88
  6. .Connection = cn.ConnectionString
  7.  
  8. .sqlFields = "cid, cin"
  9. .sqlTables = "cus0001s"
  10. .sqlSortOrder = "cin ASC"
  11.  
  12. .BoundField = "cid"
  13. .PageBy = 25
  14. .DisplayCol = 2
  15.  
  16. .setDropWindowSize 7000, 4000
  17. .TextReadOnly = True
  18. .SetDropDownTitle = "cus0001s Record"
  19. End With
  20. End Sub
Anonymous
Sir Same Error Appears

i have copied you code and entered the desired table name and connection string but it says the same

can you please check for me or give any other solutions plz......

Private Sub NSDataCombo1_Change()
With NSDataCombo1
NSDataCombo1.ClearColumn
NSDataCombo1.AddColumn "suc", 1794.89
NSDataCombo1.AddColumn "sun", 2264.88
NSDataCombo1.Connection = cn.SysConnect
'NSDataCombo1.Connection = SysConnect---this my connection string
NSDataCombo1.sqlFields = "suc, sun"
NSDataCombo1.sqlTables = "su007g9"
NSDataCombo1.sqlSortOrder = "suc ASC"
NSDataCombo1.BoundField = "sun"
NSDataCombo1.PageBy = 25
NSDataCombo1.DisplayCol = 2
NSDataCombo1.setDropWindowSize 7000, 4000
NSDataCombo1.TextReadOnly = True
NSDataCombo1.SetDropDownTitle = "su007g9 Record"
End With

End Sub

admin's picture
Online
Joined: 11/14/2008
re: Sir Same Error Appears

Why you declare the connection properties twice?

Offline
Joined: 06/20/2009
Sir

One is Commented out i have only declared just one the other one is commented out.

i am very eagerly waiting for you help sir,

admin's picture
Online
Joined: 11/14/2008
re: Sir

Again, why you put that in the change event? That is not the proper way. You should put that under load even or in any procedure and call it everywhere before you use that control.

I think that's where you stuck up.

Anonymous
Excellent Sir

You Have Sougted out my biggest problem sir you are simply great cheif all the best and god bless

admin's picture
Online
Joined: 11/14/2008
re: Excellent Sir

Thanks

Offline
Joined: 11/17/2008
I am trying to Enter a condition to list data in NSDATA COMBO

Sir,
You Solution worked and i really thank full to you
but when i try to a condition it dosnt work
i will paste my code here plz have look can i get solution for this

With NSDataCombo2
.ClearColumn
.AddColumn "Item Code", 6400.89
.Connection = SysConnect
.sqlFields = "Select Pc From Sre00rv001 where dn='" & (NSDataCombo1.Text) & "'"
.sqlFields = "pc"
.PageBy = 25
.DisplayCol = 1
.setDropWindowSize 6500, 3000
.TextReadOnly = False
.SetDropDownTitle = "Receiving Voucher Information"
End With
here it shows blank where as there is data in that condition

can u please help me out in this......

Anonymous
need help for condition listing in NSDCOMBO

Sir,
You Solution worked and i really thank full to you
but when i try to a condition it dosnt work
i will paste my code here plz have look can i get solution for this

With NSDataCombo2
.ClearColumn
.AddColumn "Item Code", 6400.89
.Connection = SysConnect
.sqlFields = "Select Pc From Sre00rv001 where dn='" & (NSDataCombo1.Text) & "'"
.sqlFields = "pc"
.PageBy = 25
.DisplayCol = 1
.setDropWindowSize 6500, 3000
.TextReadOnly = False
.SetDropDownTitle = "Receiving Voucher Information"
End With
here it shows blank where as there is data in that condition

can u please help me out in this

admin's picture
Online
Joined: 11/14/2008
re: need help for condition listing in NSDCOMBO

You cannot put the where clause within sqlFields properties. There is a separate properties for the where clause.

See the code below:

  1. With NSDataCombo2
  2. .ClearColumn
  3. .AddColumn "Item Code", 6400.89
  4. .Connection = SysConnect
  5. .sqlFields = "Pc"
  6. .sqlFields = "pc"
  7. .sqlwCondition = "dn='" & NSDataCombo1.Text & "'"
  8. .PageBy = 25
  9. .DisplayCol = 1
  10. .setDropWindowSize 6500, 3000
  11. .TextReadOnly = False
  12. .SetDropDownTitle = "Receiving Voucher Information"
  13. End With
Anonymous
Please help me about this...

Sir,
can you helpme please?!!!
can you give me a sample code for the enrollment System?
what is the process to do for this?

Anonymous
sir helpme plaese

sir help me for the code for Enrollment System!!!

thank you more power and GOD Bless!!!

I hope that u response about this..

Anonymous
Program the control

Hi

Is there are way to open the drop down on gotfocus event and set the focus in search field. And then when ever any user presses any key the list should get filtered automatically without the need to press "Enter"

admin's picture
Online
Joined: 11/14/2008
re: Program the control

Sorry but you cannot do this without the original source code. Philip Naparan is selling the source code. If you like I can negotiate from him so you will have the source code.

Pages

Add new comment

Filtered HTML

  • You may insert videos with [video:URL]
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <asp>, <c>, <cpp>, <csharp>, <css>, <html4strict>, <java>, <javascript>, <mysql>, <php>, <python>, <sql>, <vb>, <vbnet>. The supported tag styles are: <foo>, [foo].
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.