|
There is a standard, %, I don't know if its in writing but everything I've seen except Access uses it
Access (and DAO) is used on windows only, so it made sense to use * as the 'match anything wildcard' which is what windows uses.
James
Sonork: Hasaki
"I left there in the morning
with their God tucked underneath my arm
their half-assed smiles and the book of rules.
So I asked this God a question
and by way of firm reply,
He said - I'm not the kind you have to wind up on Sundays."
"Wind Up" from Aqualung, Jethro Tull 1971
|
|
|
|
|
Because * replace the rest of characters and % replace only One Character....
For Example if you have a table with the following records
Mother
My
Mine
M* get all the records
and M% only the Second Record...
Best Regards
Carlos Antollini.
Sonork ID 100.10529 cantollini
|
|
|
|
|
Carlos Antollini wrote:
M% only the Second Record...
No,Carlos.Thats not true.'%' get all of them too.
Mazy
"The path you tread is narrow and the drop is shear and very high,
The ravens all are watching from a vantage point near by,
Apprehension creeping like a choo-train uo your spine,
Will the tightrope reach the end;will the final cuplet rhyme?"Cymbaline-Pink Floyd
|
|
|
|
|
Mazy It's True...
I found the following:
Kind of match Pattern Match (returns True) No match (returns False)
Multiple characters a*a aa, aBa, aBBBa
*ab* abc, AABB, Xab aZb, bac
Special character a[*]a a*a aaa
Multiple characters ab* abcdefg, abc cab, aab
Single character a?a aaa, a3a, aBa aBBBa
Single digit a#a a0a, a1a, a2a aaa, a10a
Range of characters [a-z] f, p, j 2, &
Outside a range [!a-z] 9, &, % b, a
Not a digit [!0-9] A, a, &, ~ 0, 1, 9
Combined a[!b-m]# An9, az0, a99 abc, aj0
Best Regards....;)
Carlos Antollini.
Sonork ID 100.10529 cantollini
|
|
|
|
|
In T-SQL (SQL Server) the % character will do a wildcard beyond that point(all characters)
'boo%' results in book, books, boobs....
the _ character will act as a single wildcard
'b_ok' will find anything for the second character(i.e. - book).
Nick Parker
|
|
|
|
|
Oh thanks a lot , that explains everything
- Dan
"Intel inside - Idiot outside"
|
|
|
|
|
Dammit!
I'm totaly confused now!
Someone said that % is for one char and * for all. Someone else said % is standard and * for DAO/ADO. What happening!?
- Dan
"Intel inside - Idiot outside"
|
|
|
|
|
I have an app that emails automatically from an ASP page - it works fine but for one specific user I get the error message "MSG 17914, Level 18, State 1, line 0 - Unknown recipient: Parameter '@recipients', recipient 'nameofuser'" where 'nameofuser' is of course, the name of the user. Am I missing something? What's different about this guy that he can use xp_sendmail?
-----------------------------------------------------------------
I found out 2day that he can execute xp_sendmail IF he is listed as recipient = 'nameofuser@coname.com' as opposed to just 'nameofuser' like everyone else. He has the same permissions on the server as the other users - I'm still REALLY confused! but he's a happy user & I'm good 4 now... any ideas?
|
|
|
|
|
Hi,
Ok - first a plea! I NEED help with this - it's been driving me crazy and I know it's a really simple problem, but I've been too knocked out with this stupid code to spot it.
I have an Access database with several tables, including one named tblSchedule. It has seven fields, declared in this order:
ID - Autonumber
EmployeeID - Number
JobID - Number
Date - Date/time
AreaID - number
Description - text
Status - Number
You can download a database containing the exact schema for this table here.
OK, now, in VB I have the following code:
' Write a schedule entry to the database
'
' IN
' sched - the schedule entry
'
' OUT - success?
Public Function CreateScheduleEntry(sched As cScheduleEntry) As Boolean
On Error GoTo Error
Dim adoConn As New ADODB.Connection
Set adoConn = OpenDatabase
adoConn.Execute "INSERT INTO tblSchedule " & sched.FormatSQL & ";"
adoConn.Close
CreateScheduleEntry = True
Exit Function
Error:
CreateScheduleEntry = False
Exit Function
End Function
The schedule object looks like this:
Public ID As Integer
Public Employee As cEmployee
Public job As cJob
Public ScheduleDate As Date
Public Area As cArea
Public Description As String
Public Status As Integer
' Returns a SQL statement formatted for an INSERT INTO statement,
' of formtat ({fields}) VALUES ({values})
'
' IN
' OUT - SQL string as described above
Public Function FormatSQL() As String
FormatSQL = "(" & _
"EmployeeID,JobID,Date,AreaID,Description,Status" & _
") VALUES (" & _
Employee.ID & "," & _
job.ID & "," & _
"#" & Month(Date) & "/" & Day(Date) & "/" & Year(Date) & "#," & _
Area.ID & "," & _
QuoteString(Description) & "," & _
Status & _
")"
End Function The INSERT INTO fails EVERY time. So I thought, well, if I can't get it to work this way, how about executing a basic INSERT INTO statement against the table. But that doesn't work either:
INSERT INTO tblSchedule (EmployeeID,JobID,Date,AreaID,
Description,Status) VALUES (1,2,#4/1/2002#,4,'test',1) Any help on this will be really really really really really appreciated. I just know it's gonna be a stupid, simple, problem, but at the minute I'm too blind to see it.
The QuoteString function just double quotes a string so that apostraphes don't mess up the SQL statement. This exact code, with changed field names, is used on another table and works fine.
Thanks!
--
Andrew.
|
|
|
|
|
If you rename the "date" column to "mydate" then the insert works. Looks like "date" is a reserved word un Access. I tend to use a common prefix across all of the columns in a table to ensure that I don't get a reserved-word clash.
|
|
|
|
|
Remind me to buy you a drink of your chosen beverage next time we meet ! Thanks, I knew it would be simple, but it was driving me up the wall!!
--
Andrew.
|
|
|
|
|
Another thing you can try is enclose the reserved words in [ and ] i.e. [Date]
Bruce Duncan CP#9088, CPUA 0xA1EE, Sonork 100.10030 Hi everyone. My name's Bruce. And I suffer from VB.
|
|
|
|
|
I'm currently thrust back into the world of SQL Server Development after being away for quiet a while. I'm using the SQL Enterprise Manager to edit stored procedures.
What does everybody else use? Are there some better tools out there than SQL Enterprise Manager for creating and updating stored procedures?
Michael
|
|
|
|
|
Michael P Butler wrote:
What does everybody else use?
I use the same thing and I don't have any problem with that.;)
Mazy
"So,so you think you can tell,
Heaven from Hell,
Blue skies from pain,...
How I wish,how I wish you were here." Wish You Were Here-Pink Floyd-1975
|
|
|
|
|
It is useable but it lacks the qualities of a decent IDE. I've taken to writing the procedure in the VC++ IDE and pasting them into Enterprise Manager. However this method isn't much use for making changes.
I was hoping I'd overlooked a cool Microsoft SQL development tool somewhere and somebody could point it out to me and then laugh at me for being a dumb ass for still using Enterprise Manager
Michael
|
|
|
|
|
It seems that I'm out of date. (I hope I use correct word,my english is not very good.)I have to do something for myself.;)
Mazy
"So,so you think you can tell,
Heaven from Hell,
Blue skies from pain,...
How I wish,how I wish you were here." Wish You Were Here-Pink Floyd-1975
|
|
|
|
|
I use Query Analyzer and like it a lot better than Enterprise Manager.
Andy Gaskell, MCSD MCDBA
|
|
|
|
|
Doh. I've been using it with the object browser window hidden.
I am a dumbass. Thanks for pointing it out, that is much better for editing stored procedures.
Michael
|
|
|
|
|
hi all,
I got the following error while running the asp page that makes use of Stored Procedure .What might be the problem ????
Microsoft VBScript runtime error '800a01b6'
Object doesn't support this property or method:
'CreateParameter(...).Append'
thanks
|
|
|
|
|
Could you give more details? When you use a command object, you usually need to do something like:
set cm = server.createobject("ADODB.Command")
cm.Parameters.Append cm.CreateParameter(...)
HTH
Wanderley
|
|
|
|
|
I'm using ADO to interface with MSDE (Microsoft SQL Server 7) but I still have some doubts:
1. What the 'sa' UserID ? Can I use it from my app ?
2. How can I create new accounts (userid+password) for the SQL Servers ? (no NT accounts) I have scanned all options of the "osql.exe" utility but I have found nothing.
Thanks in advance.
|
|
|
|
|
Frankesk wrote:
1. What the 'sa' UserID ? Can I use it from my app ?
Administrator. Don't use this for normal stuff, as it gives complete access to the database. e.g. create\delete databases, tables, etc. Equivelant of logging into the NT Machine as the local admin.
Frankesk wrote:
2. How can I create new accounts (userid+password) for the SQL Servers ? (no NT accounts) I have scanned all options of the "osql.exe" utility but I have found nothing.
Well I don't know about the MSDE extact, as I usually develop on a copy of SQL Server with the Enterprise Manager - which is a GUI front end with wizards etc to create new DB's, tables, Views all the way to new users and roles.
Otherwise you may have to do it programatically.
On Windows 2000, goto the Control Panel, Admin Tools, Server Extensions Admin. From the menu Add\Remove, and then add from the botton of the dialog. Choose Micorsoft Enterprise Manager.
From there you can then administor the Server though the MMC pluggin.
Hope this helps,
Giles
|
|
|
|
|
I'm going to search for the XP version of the admin extensions, if they exist.
Thanks.
|
|
|
|
|
Frankesk wrote:
1. What the 'sa' UserID ? Can I use it from my app ?
This is the administrator account in SQL Server. You can use this if you want, but its probably best to create a user with the minimum set of access rights required to do what you want.
Frankesk wrote:
2. How can I create new accounts (userid+password) for the SQL Servers ? (no NT accounts) I have scanned all options of the "osql.exe" utility but I have found nothing.
Have a look at sp_adduser and sp_addlogin in the BOL.
Dave
|
|
|
|
|
Recently i meet with a problem:
I want to store a word document into SQL SERVER and the field is image,but don't select from SQL SERVER.How can i do?
thanks!
|
|
|
|
|