I LOVE YOU
Dec 6, 2006!!!!!!!
View 16 Replies!!!!!!!
View 16 Repliesi LOVE MEN.. ANY OFFERS
View 9 Replies View RelatedDoes anybody know of some utility or code or script which I could use to rapidly change the server name in the connections of a fairly large number of DTS packages?
I'm convinced that this must be possible from code using the DTS libraries, but I just don't have time to sit down and figure it all out.
Any suggestions?
Thanks in advance
David Westmore
Hey, I'm sorry for posting without checking the entire forum yet:) been on a few other sites, this is probley a basic problem but I can't figure it.
Simply put I am using Access VBA to insert into a table.. which contains 3 datetime columns. However I get a char has given out of range datetime value. Or i can get 01/01/1900. Or sometimes I get a date that looks to be 01/01/1900 minus the current date.
Tryed formating, using/not using the 's.
And I know this is access stuff.. my main question is, is the problem a SQL server 2005 error or a vba one.
Sorry if this is in the wrong place and thanks for your time anyway:)
I won't be back for a little, home time for the day. I'll be back in the office early tomorrow.
This is a demo string that is sent to the SQL Server.. messy:(
INSERT INTO dbo.DeliveryPackages
(Status, Long_Description, Short_Description, Career, Start_Term, Owning_Campus, Start_Date, End_Date, Student_Quota, Formal_Description, PEP_Prog_Activate, PEP_DP_Activate, International, Class_Delivery, QTAC, QTAC_Code, Owning_User, Modified_User, Modified_Date, IO_Level, IO_Number, Acad_org, Fund_source, Approved, Modified, DP_Notes)
values
('2', 'TNQMBASPMF,', 'hjk', '2', '3700', 'TNQ', 25-01-2016, 31-01-2018, '57', 'gjkhjk', 'False', 'True', 'True', '1', 'True', 'Pending', 'mansonj', 'mansonj', 14-08-2006, '2', 'New IO', 'TNQATSG101', 'BHE', '0' , '1', '')
The code is this.. sorry for the formating and the 'easy' to understand names:P
***Just sets up the variables/connection etc***
Dim conn As ADODB.Connection
Dim strSQL As String
Dim strColumns As String
Dim strValues As String
Set conn = CurrentProject.Connection
Dim cmd As ADODB.Command
Set cmd = New ADODB.Command
Dim strTimestamp As String
Dim strStartDate As String
Dim strEndDate As String
strStartDate = Format(txtStartDate.Value, "dd-mm-yyyy")
strEndDate = Format(txtEndDate.Value, "dd-mm-yyyy")
strTimestamp = Format(Date, "dd-mm-yyyy")
cmd.ActiveConnection = conn
cmd.CommandType = adCmdText
***Building the Columns String***
strColumns = "Status, Long_Description, Short_Description, Career, Start_Term, Owning_Campus, Start_Date, End_Date, "
strColumns = strColumns & "Student_Quota, Formal_Description, PEP_Prog_Activate, PEP_DP_Activate, International, "
strColumns = strColumns & "Class_Delivery, QTAC, QTAC_Code, Owning_User, Modified_User, Modified_Date, IO_Level, "
strColumns = strColumns & "IO_Number, Acad_org, Fund_source, Approved, Modified, DP_Notes"
***Building the Values String***
strValues = "'" & cboStatus.Value & "', '" & txtLong.Value & "', '" & txtShort.Value & "', '" & cboCareer.Value & "', '" & cboStartTerm.Value
strValues = strValues & "', '" & txtOwningCampus.Value & "', " & strStartDate & ", " & strEndDate & ", '" & txtStudentQuota.Value
strValues = strValues & "', '" & txtFormalDescription.Value & "', '" & CBool(chkProg.Value) & "', '" & CBool(chkDP.Value) & "', '" & CBool(chkInternational.Value)
strValues = strValues & "', '" & cboDelivery.Value & "', '" & CBool(chkQTAC.Value) & "', '" & txtCode.Value & "', '" & txtusername.Value
strValues = strValues & "', '" & txtusername.Value & "', " & strTimestamp & ", '" & txtLevel.Value & "', '" & txtIOnumber.Value & "', '" & txtAcad_org.Value
strValues = strValues & "', '" & txtfund.Value & "', '0' , '1', '" & txtDP_Notes.Value & "'"
***This puts the string together and sends it away***
strSQL = "INSERT INTO dbo.DeliveryPackages (" & strColumns & ") values (" & strValues & ")"
cmd.CommandText = strSQL
cmd.Execute