revpree 0 Newbie Poster

Hi,

Can anyone please help me in this.

i want to retrieve a view in VB.i was able to do with the below script when using tables,but not with view

Dim strSQL_revenue As String
Set rs_revenue = New ADODB.Recordset
strSQL_revenue = " select * from dbo.PLAN_PNL_INTERUNIT_REV"
    With rs_revenue
        .Source = strSQL_revenue
        .ActiveConnection = adoCon
        .CursorType = adOpenStatic
        .CursorLocation = adUseClient
        .LockType = adLockOptimistic
        .Open  'Options:=adCmdText
    End With

"dbo.PLAN_PNL_INTERUNIT_REV" is my view name.

its throwing out a run time error.

Please help me out what should i do here.

Any help is appreciable.

Regards,
Rev

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.