Click here to Skip to main content
15,879,613 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: header & footer not disaplay when conveting word to htm Pin
koolprasad200318-May-07 1:24
professionalkoolprasad200318-May-07 1:24 
GeneralRe: header & footer not disaplay when conveting word to htm Pin
Dave Kreskowiak18-May-07 3:39
mveDave Kreskowiak18-May-07 3:39 
GeneralRe: header & footer not disaplay when conveting word to htm Pin
koolprasad200318-May-07 20:44
professionalkoolprasad200318-May-07 20:44 
GeneralRe: header & footer not disaplay when conveting word to htm Pin
Dave Kreskowiak19-May-07 3:54
mveDave Kreskowiak19-May-07 3:54 
QuestionCaller ID Software Pin
humill_bca17-May-07 21:43
humill_bca17-May-07 21:43 
JokeRe: Caller ID Software Pin
Sonia Gupta17-May-07 21:45
Sonia Gupta17-May-07 21:45 
AnswerRe: Caller ID Software Pin
Dave Kreskowiak18-May-07 3:37
mveDave Kreskowiak18-May-07 3:37 
QuestionWhat is Wrong with my code [modified] Pin
Vimalsoft(Pty) Ltd17-May-07 20:37
professionalVimalsoft(Pty) Ltd17-May-07 20:37 
here is my code that is in Class module , its my connection to the clients Table in a ValrollDB in vb6. The Previous Programmer who worked on it, Created a database in Access, and it had its up and downs, so i decided Export it to SQL. it well and working. i can connect and Populate datagrid. Now in my VB form i have a Datagrid and a search textbox and a button , when you click the Button without any search critiria, it will display everything. in the code that the Previous Programmer has wring i only changed the Connection to Point in Sql server. Now when i try to use the Search based Critiria it gives an Error. Here my code in a module, Please tell me what shoudl i change from his code, because i only change the Connection. and it gives an Error that says "The Operation is not alowed when Connection is Open"

+++++++++++++++++++++++
My Code
+++++++++++++++++++++++++

Dim WithEvents adoPrimaryRS As Recordset
Private DoingRequery As Boolean
Public Event MoveComplete()
Private Sub Class_Initialize()
Dim sSQL As String
Dim db As Connection
Set db = New Connection
db.CursorLocation = adUseServer
'Connection
CN.ConnectionString = _
"Provider=SQLOLEDb;Password=topology:User ID=sde:Location=SGIICORNETGS01;database = ValRoldb"

sSQL = "Select Name from owner"
Set adoPrimaryRS = New Recordset
'GetOwner
If OpenCN Then
adoPrimaryRS.Open BuiltSQL, CN, adOpenForwardOnly, adLockOptimistic

DataMembers.Add "Primary"
End If

End Sub

Private Sub Class_GetDataMember(DataMember As String, Data As Object)
Select Case DataMember
Case "Primary"
Set Data = adoPrimaryRS
End Select
End Sub

Private Sub adoPrimaryRS_MoveComplete(ByVal adReason As ADODB.EventReasonEnum, ByVal pError As ADODB.Error, adStatus As ADODB.EventStatusEnum, ByVal pRecordset As ADODB.Recordset)
RaiseEvent MoveComplete
End Sub

Private Sub adoPrimaryRS_WillChangeRecord(ByVal adReason As ADODB.EventReasonEnum, ByVal cRecords As Long, adStatus As ADODB.EventStatusEnum, ByVal pRecordset As ADODB.Recordset)
'This is where you put validation code
'This event gets called when the following actions occur
Dim bCancel As Boolean
Select Case adReason
Case adRsnAddNew
Case adRsnClose
Case adRsnDelete
Case adRsnFirstChange
Case adRsnMove
Case adRsnRequery
Case adRsnResynch
Case adRsnUndoAddNew
Case adRsnUndoDelete
Case adRsnUndoUpdate
Case adRsnUpdate
End Select

If bCancel Then adStatus = adStatusCancel
End Sub

Public Property Get EditingRecord() As Boolean
EditingRecord = (adoPrimaryRS.EditMode <> adEditNone)
End Property

Public Property Get AbsolutePosition() As Long
AbsolutePosition = adoPrimaryRS.AbsolutePosition
End Property

Public Sub Requery()
adoPrimaryRS.Requery
DataMemberChanged "Primary"
End Sub

Public Sub MoveFirst()
If Not adoPrimaryRS.EOF And adoPrimaryRS.BOF Then
adoPrimaryRS.MoveFirst
End If
End Sub

Public Sub MoveLast()
If Not adoPrimaryRS.EOF Or Not adoPrimaryRS.BOF Then
adoPrimaryRS.MoveLast
End If
End Sub

Public Sub MoveNext()
If Not adoPrimaryRS.EOF Then adoPrimaryRS.MoveNext
If adoPrimaryRS.EOF And adoPrimaryRS.RecordCount > 0 Then
Beep
'moved off the end so go back
adoPrimaryRS.MoveLast
End If
End Sub

Public Sub MovePrevious()
If Not adoPrimaryRS.BOF Then adoPrimaryRS.MovePrevious
If adoPrimaryRS.BOF And adoPrimaryRS.RecordCount > 0 Then
Beep
'moved off the end so go back
adoPrimaryRS.MoveFirst
End If
End Sub

The error will point the Connection lines.

Help


-- modified at 2:53 Friday 18th May, 2007


-- modified at 3:05 Friday 18th May, 2007

Vuyiswa

AnswerRe: What is Wrong with my code Pin
Dave Kreskowiak18-May-07 3:36
mveDave Kreskowiak18-May-07 3:36 
QuestionTimed Demo Pin
ashamsa17-May-07 20:13
ashamsa17-May-07 20:13 
AnswerRe: Timed Demo Pin
Sonia Gupta17-May-07 20:20
Sonia Gupta17-May-07 20:20 
GeneralRe: Timed Demo Pin
ashamsa17-May-07 20:56
ashamsa17-May-07 20:56 
AnswerRe: Timed Demo Pin
Sonia Gupta17-May-07 21:08
Sonia Gupta17-May-07 21:08 
Questionconversion fom C# to vb.net Pin
Sonia Gupta17-May-07 19:55
Sonia Gupta17-May-07 19:55 
AnswerRe: conversion fom C# to vb.net Pin
Christian Graus17-May-07 21:10
protectorChristian Graus17-May-07 21:10 
QuestionRe: conversion fom C# to vb.net [modified] Pin
Sonia Gupta17-May-07 21:21
Sonia Gupta17-May-07 21:21 
AnswerRe: conversion fom C# to vb.net Pin
Christian Graus17-May-07 23:19
protectorChristian Graus17-May-07 23:19 
GeneralRe: conversion fom C# to vb.net Pin
Sonia Gupta18-May-07 0:29
Sonia Gupta18-May-07 0:29 
GeneralRe: conversion fom C# to vb.net Pin
Dave Kreskowiak18-May-07 3:26
mveDave Kreskowiak18-May-07 3:26 
AnswerRe: conversion fom C# to vb.net Pin
Dave Doknjas18-May-07 13:39
Dave Doknjas18-May-07 13:39 
GeneralRe: conversion fom C# to vb.net Pin
Dave Doknjas18-May-07 13:42
Dave Doknjas18-May-07 13:42 
Questionaccess specifiers Pin
navyasri17-May-07 19:52
navyasri17-May-07 19:52 
AnswerRe: access specifiers [modified] Pin
Sonia Gupta17-May-07 20:01
Sonia Gupta17-May-07 20:01 
AnswerNever heard about DOCUMENTATION? Pin
CPallini17-May-07 21:08
mveCPallini17-May-07 21:08 
Questiondate/time Pin
Sonia Gupta17-May-07 18:28
Sonia Gupta17-May-07 18:28 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.