Girish Gopi
November 20th, 1999, 01:57 AM
Private Sub Command1_Click()
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
Can you Tell Me why
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
Can you Tell Me why