Girish Gopi
November 21st, 1999, 10:58 PM
Set con = New ADODB.Connection
Set cmd = New ADODB.Command
With con
.ConnectionString = "Provider=MSDataShape.1;DRIVER={SQL Server};Uid=sa;Pwd=;SERVER=Server02;DATABASE=ComDemo;DSN=;"
.Open
End With
With cmd
.ActiveConnection = con
.CommandType = adCmdStoredProc
.CommandText = "InsertCmstScheme"
For parmcnt = 1 To 10
.Parameters(parmcnt).Direction = adParamInput
Next
.Parameters("@SName") = m_str_SchemeName
.Parameters("@MinDeposit") = m_sgl_MinimumDeposit
.Parameters("@DepositDuration") = m_int_DepositDurationInMonths
.Parameters("@InterestFrequency") = m_str_InterestFrequency
.Parameters("@InterestType") = m_str_InterestType
.Parameters("@LockInPeriod") = m_int_LockInPeriod
.Parameters("@InterestRate") = m_sgl_InterestRate
.Parameters("@Brokerage") = m_sgl_Brokerage
.Parameters("@IntrestRateThroughBroker") = m_sgl_InterestRateThroughBroker
End With
End Sub
This Code Does Not Work
But Instead of ConnectionString If I use DSN IT Works Code Given Below
Set con = New ADODB.Connection
Set cmd = New ADODB.Command
With con
.Open("DSNNAME")
End With
With cmd
.ActiveConnection = con
.CommandType = adCmdStoredProc
.CommandText = "InsertCmstScheme"
For parmcnt = 1 To 10
.Parameters(parmcnt).Direction = adParamInput
Next
.Parameters("@SName") = m_str_SchemeName
.Parameters("@MinDeposit") = m_sgl_MinimumDeposit
.Parameters("@DepositDuration") = m_int_DepositDurationInMonths
.Parameters("@InterestFrequency") = m_str_InterestFrequency
.Parameters("@InterestType") = m_str_InterestType
.Parameters("@LockInPeriod") = m_int_LockInPeriod
.Parameters("@InterestRate") = m_sgl_InterestRate
.Parameters("@Brokerage") = m_sgl_Brokerage
.Parameters("@IntrestRateThroughBroker") = m_sgl_InterestRateThroughBroker
End With
End Sub
Can you Tell Me why And How Do I Use The Above Methode With A Connection String
Rate this post :
3 : Excellent!
2 : Useful / Answers the question
1 : Good suggestion or hint
--- Select an option ---
-1 : Not useful / wrong / off-topic
Set cmd = New ADODB.Command
With con
.ConnectionString = "Provider=MSDataShape.1;DRIVER={SQL Server};Uid=sa;Pwd=;SERVER=Server02;DATABASE=ComDemo;DSN=;"
.Open
End With
With cmd
.ActiveConnection = con
.CommandType = adCmdStoredProc
.CommandText = "InsertCmstScheme"
For parmcnt = 1 To 10
.Parameters(parmcnt).Direction = adParamInput
Next
.Parameters("@SName") = m_str_SchemeName
.Parameters("@MinDeposit") = m_sgl_MinimumDeposit
.Parameters("@DepositDuration") = m_int_DepositDurationInMonths
.Parameters("@InterestFrequency") = m_str_InterestFrequency
.Parameters("@InterestType") = m_str_InterestType
.Parameters("@LockInPeriod") = m_int_LockInPeriod
.Parameters("@InterestRate") = m_sgl_InterestRate
.Parameters("@Brokerage") = m_sgl_Brokerage
.Parameters("@IntrestRateThroughBroker") = m_sgl_InterestRateThroughBroker
End With
End Sub
This Code Does Not Work
But Instead of ConnectionString If I use DSN IT Works Code Given Below
Set con = New ADODB.Connection
Set cmd = New ADODB.Command
With con
.Open("DSNNAME")
End With
With cmd
.ActiveConnection = con
.CommandType = adCmdStoredProc
.CommandText = "InsertCmstScheme"
For parmcnt = 1 To 10
.Parameters(parmcnt).Direction = adParamInput
Next
.Parameters("@SName") = m_str_SchemeName
.Parameters("@MinDeposit") = m_sgl_MinimumDeposit
.Parameters("@DepositDuration") = m_int_DepositDurationInMonths
.Parameters("@InterestFrequency") = m_str_InterestFrequency
.Parameters("@InterestType") = m_str_InterestType
.Parameters("@LockInPeriod") = m_int_LockInPeriod
.Parameters("@InterestRate") = m_sgl_InterestRate
.Parameters("@Brokerage") = m_sgl_Brokerage
.Parameters("@IntrestRateThroughBroker") = m_sgl_InterestRateThroughBroker
End With
End Sub
Can you Tell Me why And How Do I Use The Above Methode With A Connection String
Rate this post :
3 : Excellent!
2 : Useful / Answers the question
1 : Good suggestion or hint
--- Select an option ---
-1 : Not useful / wrong / off-topic