Welcome, Register for free! or Login below:
EduGeek.net RSS Feeds Register FAQ Members Social Groups User Map Calendar Search Today's Posts Mark Forums Read

Go Back   EduGeek.net Forums > Coding and Web Development > Coding
Reply
 
LinkBack Thread Tools Search Thread Language
Sponsored Links
Old 27-11-2006, 12:45 PM   #1
 
k-strider's Avatar
 
Join Date: Oct 2006
Location: Gloucester
Posts: 142
Thanks: 0
Thanked 2 Times in 2 Posts
Rep Power: 5 k-strider is on a distinguished road
Default MSSQL Trigger (i think) Question

Ok I am in no way even an armature in SQL..... but this is what I want to do... we are trying to log usage of staff laptops, so I adapted a script my old colleague wrote for logging users who login anywhere in the school… (this should in theory catch them too but the staff laptops aren’t named in an easy selectable manner to run a query against the existing table so I just want to put them into another table too..

So I successfully changed the script and it works… however I had a problem with the Date (so does the original but as its for tracking students in IT rooms its ok), I guess some of the laptops must have American regional settings as it doesn’t insert a row when I include the date field (with a couple of exceptions)… so I was wondering rather than the script inserting the date can I get the server to automatically append the date to the row when it detects an insert? (I could also get rid of my Time Colum if I get the date field to work correctly…)

Original snippet (only caught some users because of the date field)

Code:
s = Wshnetwork.computername
nm = wshnetwork.username

theTime = FormatDateTime (now(),4)
theDate = Date()

	s_sql = "INSERT INTO Teach_Sign (SignUser, SignComputer, SignTime,  SignDate) VALUES ('" & nm & "','" & s & "','" & theTime & "','" & theDate & "')"
	m_rs.open s_SQL, m_cn, adOpenStatic


My Script Snipit that works… but cause I removed the date field they all appear as 01/01/1900 00:00

Code:
s_sql = "INSERT INTO Teach_Sign (SignUser, SignComputer, SignTime) VALUES ('" & nm & "','" & s & "','" & theTime &  "')"
Like I said I would prefer the server side to append the date field but if you know how to make the VBS force the date to UK easily too that would do!!

Thanks Gordy.
  Reply With Quote
Reply

Register now for FREE and post messages!


Username: Password: Confirm Password: E-Mail: Confirm E-Mail:
Birthday:      
Image Verification
  I agree to forum rules 

Similar Threads
Thread Thread Starter Forum Replies Last Post
SIMS on MSSQL 2005 AlexB MIS Systems 9 07-11-2007 10:20 AM
Open Source CMS that can use MSSQL ICTNUT Windows 4 29-03-2007 03:08 PM
WSUS & Sophus - MSSQL ?? tech_master Windows 3 18-01-2007 07:22 PM
MSSQL Trigger (i think) Question k-strider Coding 3 28-11-2006 01:15 PM
Autocreate AD accounts from MSSQL CyberNerd Coding 9 12-07-2006 03:00 PM



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search Thread
Search Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT +1. The time now is 07:24 PM.
Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 ©2008, Crawlability, Inc.
Copyright EduGeek.net