|
Reason is that you are using ado to connect to access while i am using plain odbc.
|
|
|
|
|
Has anybody used MySQL via MFC? If so please point my in the right direction. Example code / db would be very useful..
"Life begins at 140"
|
|
|
|
|
hilo, i'm a newbie at VB.NET... and i've wrote in VB.NET
i've been trying examples from reference books and online reference... but it seems that i either got the syntax wrong or just could not get it right, i think that i have something somewhere wrong with the Join table part. as i have to use 3 different tables to get the result.
anyone, pls help out... thank you! veri veri much!
my syntax are as follows...
'''''''''''''''''''''''''''''''''''''''''''''''''''
Dim objDataSet As New DataSet("ValidReasonList")
Dim cnn As SqlConnection
Dim cmd As SqlDataAdapter
Dim sql As String
Dim tblValidReasons As New DataTable("ValidReasons")
cnn = New SqlConnection("server=(local); database=sas2000; Integrated Security=SSPI")
sql = "SELECT A.APPROVED, B.ADMNO, B.DATEFROM, B.DATETO, B.REASON_DESC, C.REASONTYPE_NAME"
sql = sql & "FROM ABSENCE A, ABS_REASON B, ABS_REASON_TYPE C"
sql = sql & "WHERE A.REASON_ID = B.REASON_ID AND B.REASONTYPE_ID = C.REASONTYPE_ID"
sql = sql & "ORDER BY B.ADMNO"
cmd = New SqlDataAdapter(sql, cnn)
cmd.Fill(objDataSet, "JoinTable")
dgValidReasons.DataSource = objDataSet.Tables("JoinTable").DefaultView
dgValidReasons.DataBind()
''''''''''''''''''''''''''''''''''''''''''''''''''''''
|
|
|
|
|
Hi
I have Access Database.
How to set property of TextField - <strong>"Allow Zero Lenght"</strong> using only <strong>SqlAPI</strong>?
Thanks,
iLYA
http://www.terra-informatica.org/ilya/prnsniff.htm
|
|
|
|
|
Hello,
I am new to database programming (actually, I am not started yet).
I am recording some data in real-time (voice). Now I need to allow the user for searching for some data given a specific time.
I was told that I should consider using SQL, or DAO or ODBC.
I have no clue what the best thing to use is. So I am looking for some information.
Any suggestion (books, articles, code, ... ) will be largely appreciated.
Thanks a lot.
Where there is a WISH, there is a WILL.
|
|
|
|
|
I have a database created in SQL Server 7 SP3 that I want to convert to Access 2000. Is there a utility that I can use to do this or will I have to do it manually?
I have been retrenched from my job so have no access to SQL Server any more. The database is a personal one I created for myself.
Michael Martin
Australia
mmartin@netspace.net.au
"Don't belong. Never join. Think for yourself. Peace"
- Victor Stone
|
|
|
|
|
I do not know of any tool that can do this, and I doubt a comprehensive one exists since access does not support triggers or stored procedures. If your database uses triggers or stored procedures, you are probably out of luck on the conversion front.
On the other hand, MSDE is included with Office 2000 professional, and Visual Studio and can be used redistributed freely. It does not include the management tools (Enterprise manager, query analyzer), but there are some free ones available (I don't have a link handy, but I will look around and if I find some, will post them for you.)
|
|
|
|
|
Matt
thanks for the help. I don't have any triggers or stored procedures. I have MSDE but since I don't need the complexity of SQL Server I thought I would go to Access 2000.
Anyone else know of a tool I can use to convert?
Michael Martin
Australia
mmartin@netspace.net.au
"Don't belong. Never join. Think for yourself. Peace"
- Victor Stone
|
|
|
|
|
Use the Export (DTS) functionality on Enterprise Manager.
This works perfectly.
|
|
|
|
|
1. I have one Access .mdb file. How to read the names of the tables in it, using ADO
2. In the same database, how to read the description field of each column, using ADO again
Any answer will be helpfull. Thanx in advance!!!
|
|
|
|
|
See sample here
http://www.codeproject.com/database/isqlado.asp
This has the source code that you require
|
|
|
|
|
In VB for a data source named MYDB,
Dim cnn As New ADODB.Connection
Dim rs As New ADODB.Recordset
Dim i As Long, j As Long
cnn.Open "MYDB"
Set rs = cnn.OpenSchema(adSchemaTables)
Debug.Print "Number of Records ", rs.RecordCount
Debug.Print "No of Fields : ", rs.Fields.Count
For j = 0 To rs.Fields.Count - 1
Debug.Print rs.Fields(j).Name & " ";
Next j
Debug.Print
For i = 0 To rs.RecordCount - 1
For j = 0 To rs.Fields.Count - 1
Debug.Print rs.Fields(j).Value & " ",
Next j
Debug.Print
rs.MoveNext
Next i
rs.Close
cnn.Close
This should enumerate what tables the database contains. Its a bit like opening a recordset of what tables exist. Tables in tables......
Hope this helps.
Giles
|
|
|
|
|
I recently did this in VC++. If that is your language, let me know and I will post an answer.
|
|
|
|
|
How can I export database from SQL to Interbase?
|
|
|
|
|
If Interbase has a OLE DB provider then you can use DTS (Export / Import Task) from SQL Enterprise manager.
|
|
|
|
|
Thanks for your suggestion. But how can I have a OLE DB provider on Interbase. I have used Borland InterBase 6.01.
Regards,
|
|
|
|
|
check with the vendor if it supports a native OLE DB Provider for Interbase.
If not then it must have a ODBC driver for Interbase. If the ODBC driver exist then you can use this via the OLE DB provider for ODBC
Hope this helps
|
|
|
|
|
after i had delete the records by the following line:
objConnection.execute "DELETE * FROM tea_session_list"
what should i add to the statement to have the autonumber id also being resetted to be start at 1.
i dun wan to do it by compacting database...can i do it in a new script with the delete statement....what should i add to my above statement???
|
|
|
|
|
The only resonable solution to this I see is if you control the ID yourself. Either use a MAX value or a second table that stores the next ID value.
|
|
|
|
|
hi,
can I create a dynamic recordset?
i.e. once i have created a recordset using ADO , can that recordset be updated automatically in case if there is a change in the records on which the query is based.
if possible pls. give an example on how to do it.
pls help
lakshmi
|
|
|
|
|
See MSDN Examples on ADO at
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ado270/htm/mdmscadocodeexamplesinvisualc.asp
Specifically see the CursorType Sample at
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ado270/htm/mdprocursortypexvc.asp
I hope this helps
|
|
|
|
|
after i had delete the records by the following line:
objConnection.execute "DELETE * FROM tea_session_list"
what should i add to the statement to have the autonumber id also being resetted to be start at 1
aaa
|
|
|
|
|
Compacting the database will solve your problem
First, eliminate all records in your table. Then, close the database but leave Access running. The menu bar reduces to three options. Go to Tools > Options > Compact Databases.
I am not sure how you would do this at runtime !!
|
|
|
|
|
Hi all, I'm actually designing an internet application, and I'd like to know how to paginate the information retrieved from the database.
The problem is that I access a huge database (SQLServer 2000) and I don't want tho get all the records everytime I execute a query, I'd like to paginate the records and get them in different queries. I've thought of two methods to do that and I'd like to know which one is better, so if anybody knows it (or knows another way to solve it) please help me!
1.
Use SQL queries of the type
SELECT TOP x
FROM aTable
WHERE aTable.Id > @LastIdReceived
The problem I find in this method, is that I'm accessing a huge table (about 900.000 records) and is a complicated query (with Joins to a lot of other tables) so I think that if I do it this way, each time I have to execute the full query (and there's also the fact that with this way I can't know before the total amount of records affected by the query, I could do a COUNT first, but this would be another query)
2.
Create a temporary table of indexes with the query I need and then, retrieve the information I need by joining it with the real table (with the amount of records I need). The problem I see this way is that if there are a lot of users asking for queries at the same time, creating so many temporary tables might be inefficient.
So, If somebody has ever faced this problem I'd like to know which way is better or if there's another way I've not thought about.
Thanks.
|
|
|
|
|