Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
Ajax Application Generator Generate database and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
  #1  
Old September 9th, 2004, 09:19 AM
kiran_karnati kiran_karnati is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Location: Braunschweig , Germany
Posts: 39 kiran_karnati User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 44 m 5 sec
Reputation Power: 4
Send a message via Yahoo to kiran_karnati
Unhappy Open a recordset from vba

I have opened a connetion to a databse in the shared folder but I can't be able to open a recordset of a table of this connection it says that there is a syntax failure can anyone please help me in opening a recordset of an ADODB connection.

my connection is the following please help me.
Set cnn = New ADODB.Connection
cnn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & "\\D-server\Persönlicher Ordner\CABANNA_be.mdb" & ";"
cnn.Open , "Admin", ""

MsgBox "cnn state: " & GetState(cnn.State)

' Open User table
Set rst = New ADODB.Recordset
strSQLUser = "User"
rst.Open strSQLUser, cnn, adOpenKeyset, adLockOptimistic, adCmdTable


This is showing a message that the connection state is opend but it can'T be able to open the record set what should Ihave to do.

Thanks a lot in advance.
have fun.
Kiran.

Reply With Quote
  #2  
Old September 9th, 2004, 11:56 AM
Doug G Doug G is offline
Grumpier Old Moderator
ASP Free God 11th Plane (10000 - 10499 posts)
 
Join Date: Sep 2003
Posts: 10,143 Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 3 Weeks 4 Days 18 h 33 m 48 sec
Reputation Power: 180
try

strSQLUser = "[User]"
__________________
======
Doug G
======
I didn't attend the funeral, but I sent a nice letter saying I approved of it. --Mark Twain

Reply With Quote
  #3  
Old September 10th, 2004, 02:25 AM
kiran_karnati kiran_karnati is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Location: Braunschweig , Germany
Posts: 39 kiran_karnati User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 44 m 5 sec
Reputation Power: 4
Send a message via Yahoo to kiran_karnati
Unhappy Greaaate its working , thanks a lot.

now my reocrd set is opening but can you please give me an example to how can I INSERT a record selected from my remote database and into Local databse.

I found how to update an existing record but not how to insert a new record which is selected from remote databse and insert into the local databse.

I feel lucky if I can get this answer.
Thanks in advance.

Reply With Quote
  #4  
Old September 10th, 2004, 12:03 PM
Doug G Doug G is offline
Grumpier Old Moderator
ASP Free God 11th Plane (10000 - 10499 posts)
 
Join Date: Sep 2003
Posts: 10,143 Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 3 Weeks 4 Days 18 h 33 m 48 sec
Reputation Power: 180
For starters,

http://msdn.microsoft.com/library/en-us/ado270/htm/mdmthaddnew.asp

Reply With Quote
  #5  
Old September 10th, 2004, 02:59 PM
sbaxter sbaxter is offline
Moderator: Access, SQL
ASP Free God (5000 - 5499 posts)
 
Join Date: Oct 2003
Posts: 5,126 sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 Days 1 h 2 m 51 sec
Reputation Power: 12
search the forum for a sample DB called

VBAUnbound.zip

It is a sample DB using DAO and ADO recordsets

S-

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingVisual Basic Programming > Open a recordset from vba


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway